Showing posts with label formatted. Show all posts
Showing posts with label formatted. Show all posts

Thursday, 11 August 2016

Formatted Input and output functions for string

Formatted Input and output functions for string


#include<stdio.h>
void main()
{
         char s[10];
         printf("\nEnter a string: ");
         scanf("%s", s);                  //formatted input

         printf("\nEntered string is: ");
         printf("%s", s);               //formatted output
}

Output:
Enter a string: How are you
Entered string is: How