Viewing code of EX03_9A
// ------ EX03_9A.CPP --------------
//--- Programmed By Rajesh -----
/*
Kathmandu University
Exam paper 2003
COMP 112 (Compartmental)
Section B
Q.No.9).(a) Marks = 3
Write a program to calculate the areas of the circles using a while loop
*/
#include<stdio.h>
#include<conio.h>
#define pi 3.1415
void main()
{
int radius,no,on=0;
float area;
clrscr();
printf(
"\t Kathmandu University \n"
" Exam paper 2003 \n"
" COMP 112 (Compartmental) \n"
" Section B \n"
" Q.No.9).(a) \n"
"\n\tWrite a program to calculate the areas of the circles using a while loop \n"
"\n\n\n"
"Enter the numbers of circles you want to calculate the area of:"
);
scanf("%d",&no);
while(no>0)
{
no--;
on++;
printf("\n\n\nEnter the radius for circle no.%d:",on);
scanf("%d",&radius);
area = (float)pi*radius*radius;
printf("\nThe area of the circle is %f",area);
}
getch();
}
Home
Library Home:
- 1 1111
- 2 AVG_LINE
- 3 Assembly cubing
- 4 EX02_102
- 5 EX02_18
- 6 EX03_10A
- 7 EX03_11A
- 8 EX03_12A
- 9 EX03_9A
- 10 EX18A_R
- 11 EX1_8AR
- 12 EX2_102B
- 13 EX2_102C
- 14 EX2_Q4
- 15 EX3R9A
- 16 EX3_8A
- 17 EXCEQNO4
- 18 EXCSQ6A
- 19 EX_2_102
- 20 EX_CPLUS
- 21 FIB1
- 22 FIB2
- 23 FIB3
- 24 FIBONAC
- 25 FIB_NO_R
- 26 Fibonaci_without ercursion
- 27 MULTIRAJ
- 28 PALINDCT
- 29 PLDRM_N
- 30 Pointer matrix multiply
- 31 RAJ3
- 32 RAJAGE
- 33 RAJMAT1
- 34 RPBROKER
- 35 RPDIGIT
- 36 RPDIGIT1
- 37 RPKILOMETE
- 38 RPOVERTIME
- 39 RPRestaurantBilling
- 40 SRCOMP1
- 41 SRIIMP
- 42 STRUCTCW
- 43 socket programming