Break From The Loops !

code:

#include<stdio.h>
int main()
{
    int i,count;
    char ch;
    for(count=1; count<=100; count++)
    {
        printf("count = %d\n",count);
        printf("Do you want to continue:?\n");
        scanf(" %c",&ch); //space should be given to avoid nuisance in output
        if(ch=='y' || ch=='Y'){
            break;
        }
    }
    printf("Terminated at %d\n",count);


    return 0;
}

 

It would be a great help, if you support by sharing :)
Author: zakilive

Leave a Reply

Your email address will not be published. Required fields are marked *