Write a Program for Multiple fgets Function
Turn Mobile View Off
by Dinesh Thakur

#include <stdio.h>
#include <string.h>
char first[100];  /* First name of person we are working with */
char last[100];  /* His last name */
                      /* First and last name of the person (computed) */
char full[200];         
int main()
    printf("Enter First Name : ");
    fgets(first, sizeof(first), stdin);
    printf("Enter Last Name : ");
    fgets(last, sizeof(last), stdin);
    strcpy(full, first);
    strcat(full, " ");
    strcat(full, last);
    printf("The Name is %s", full);
    return (0);

Multiple fgets Function

Dinesh Thakur is a Technology Columinist and founder of Computer Notes and Technology Motivation. Turn Mobile View Off