using the fgets instead of scanf

#include <stdio.h>
#include<stdlib.h>

int main()

{

char name[20]; 
printf("Enter your name:");
fgets(name, 20, stdin);
printf("Your name is %s", name);

return 0;
}

Comments

Popular posts from this blog

Using Struct C

arrays in c programming

for loop with index in C