Wednesday, 21 January 2015

Getting Started with Strings in C - Using gets() and puts() functions.


This is a simple C Program which uses string functions gets() and puts() to read and display the content respectively.


PROGRAM :
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
    char name[20];
    printf("Enter any name(String) : \t");
    gets(name);
    printf("\n You Entered : " );
    puts(name);
    return 0;
}

OUTPUT : 
C Programming - Strings - gets() and puts()

No comments:

Post a Comment