|
Nested While
& do...While Loop
#include <stdio.h>
main ( )
{
int x;
char i, ans;
i = ' ';
do
{
Clrscr();
x = 0; ans = ' y' ;
printf ("\nEnter sequence of character:");
do {
i = getchar();
x++;
} while (i != '\n');
i = ' ' ;
printf("\n No.of chrs. entered: %d" , --x);
printf("\nMore sequences (Y/N)?");
ans = getch () ;
} while (ans =='y' II ans == 'Y' } );
}
|