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();
}