#include<stdio.h>
#include<conio.h>
void main()
{
    float r, area;
    char ch = 'y';
    do 
    {
        system("cls");
        printf("Enter the radius of the circle -: ");
        scanf("%f", &r);
        area = 3.14 * r * r;
        printf("The area of the circle is -: %f", area);
        printf("\n");
        printf("Do u want to try again (y/n) -: ");
        scanf("%c", &ch);
        getch();
    }
    while(ch == 'y' || ch == 'Y');
    getch();
}

Recommended Answers

Try

do 
{
    printf("\nEnter the radius of the circle -: ");
    scanf("%f", &r);
    area = 3.14 * r * r;
    printf("The area of the circle is -: %f", area);
    printf("\nDo you want to try again (y/n) -: ");
    ch = getch();
}
while(ch == 'y' || ch …
Jump to Post

All 2 Replies

Try

do 
{
    printf("\nEnter the radius of the circle -: ");
    scanf("%f", &r);
    area = 3.14 * r * r;
    printf("The area of the circle is -: %f", area);
    printf("\nDo you want to try again (y/n) -: ");
    ch = getch();
}
while(ch == 'y' || ch == 'Y');

Thank you for post,,,I have faced same problem

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.