Thursday, July 21, 2011

Program to input & print more than one words in single line

/*Serial No.102     [swami79.cpp]*/

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char s1[50];
int len;
clrscr();
printf("\nEnter the string:");
scanf("%[^\n]",s1);
printf("Output string:%-50s",s1);
len=strlen(s1);
printf("\nlength of the string =%d",len);
getch();
}

No comments:

Post a Comment

If you have any doubt, feel free to ask...