Scanning a line using scanf function
Problem statement
Write a c program to scan a line using scanf()
#include<stdio.h>
int main()
{
char line[50]; /* declairs size of line can be varied accordingly */
printf("enter line ");
scanf("%[^'\n']s",line);
printf("the line entered by you is -%s \n",line);
return 0;
}
No comments:
Post a Comment