Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

CIRCLE 5x or 10x

#include <stdio.h>
#include <conio.h>
#define PI 3.1416
main()
{
float radius, area, times;
printf("Enter the radius of the circle: ");
scanf("%f", &radius);
area= PI * radius * radius;
if (area > 45)
{
times =10;
}
else
{
times = 5;
}
for(int ctr = 1; ctr <= times; ctr++)
{
printf("\nThe area is %f", area);
}
getch();
}

#include <stdio.h>
#include <conio.h>
#define PI 3.1416
main()
{
int num, even = 0, odd = 0;
int a = 1;
do
{
printf("Enter a number : ");
scanf("%d", &num);
if (num % 2 == 0)
even++;
else
odd += 1;
a++;
}
while( a <= 10);

printf("EVEN: %d", even);


printf("ODD: %d", odd);
getch();
}

You might also like