Wednesday, August 28, 2013

gets() and do while using turbo c

 Sample Output 
 
#include<stdio.h>
#include<conio.h>
// this program code is using variable char, the gets(),  the do while statement, the char variables
// created by: boybalda46

main()
{
char name[20], course[20], school[20];// [20] maximum characters display included space
char ch;


do{
printf("name ?");gets(name);
printf("course? ");gets(course);
printf("school? ");gets(school);

printf("");
printf("\nname:"),printf(name);
printf("\ncourse:"),printf(course);
printf("\nschool:"),printf(school);

printf("\n\ntry another[y/n]?\n");
ch=getche();
clrscr();
}while((ch=='Y')||(ch=='y'));
getche();
return 0;
}
//