C Break and While Loop

11:42 Unknown 0 Comments


While Break in 'C' Programming

This is the C Program which has loop and break statement.

*Coding*

#include<stdio.h>
#include<conio.h>
void main(void)
{
 char a;
 int b=1;
 clrscr();
 a='y';
 while(a=='Y'||a=='y')
  {
   printf("%d",b);
   printf("\nDo You Wish to countinue[Y\N] : ");
   a=getche();
   if(a=='Y'||a=='y')
    {
     a=a;
    }
   else if(a=='N'||a=='n')
    {
     break;
    }
   else
    {
     printf("\n\nFunction Not Found");
     break;
    }
   b=b+1;
   clrscr();
  }
 getch();
}

0 comments: