#include <stdio.h>
int main () {
char str1[50],str2[30];
printf("Enter a string : \n");
gets(str1);
printf("You entered using gets : %s", str1);
fgets(str2,30,stdin);
printf("\nUsing fgets : %s",str2);
return(0);
}
To embed this project on your website, copy the following code and paste it into your website's HTML: