Lets Blog..
Pages
Home
Sample C Programs
Tuesday, 14 May 2013
6. Format for string input
6. /* Format for string input */
main()
{
char str[7];
clrscr();
printf("Enter a string ");
scanf("%4s",str);
puts(str); /* if the input is 'computer', the output is 'comp' */
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment