Sunday, August 19, 2012

How to repeat a program in c?



#include<stdio.h>
main()
{
    int a,b,c;
    char ans[5];
    do{printf("Hello\n");
    printf("do you want to repeat (y/n)?\n ");
    scanf("%s", ans);}
    while(ans[0]=='y'||ans[0]=='Y');
}

No comments:

Post a Comment

wait_i_will_reply_within_24_hours