Completely Solved C, C++ Programs Assignment.




C Program to accept a string and print it by using the while loop.

Filed Under:

Problem 28. C Program to accept a string and print it by using the while loop.
#include<stdio.h>
#include<conio.h>
main( )
{
char ch;
clrscr();
printf(“enter a string”);
while(( ch=getchar( ))!=’n’)
putchar(ch);
getch();
}

C compiler: gcc 4.1.2

 Back to main directory: Sample C Program | Software Practical | Solved C Assignment


Get Free Programming Tutorials and Solved assignments