Showing posts with label Program to input and print more than one words in single line. Show all posts
Showing posts with label Program to input and print more than one words in single line. Show all posts

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();
}