1#include <stdio.h>
2
3int main(){
4 char name[20];
5
6 printf("Enter a name : ");
7 scanf("%[^\n]%*c", &name);
8
9 printf("the name entered is: %s\n", name);
10
11return 0;
12}
1#include <stdio.h>
2
3int main () {
4 char str1[90], str2[90];
5
6 printf("Enter name: \n");
7 scanf("%s", &str1);
8
9 printf("Enter your website name: \n");
10 scanf("%s", &str2);
1#include<stdio.h>
2#include<conio.h>
3void main(){
4chat sam[10];
5clrscr();
6printf("ENTER STRING NAME :");
7gets(s);
8printf("STRING :%s",s);
9getch();
10}
1#include <stdio.h>
2#include <string.h>
3#include <math.h>
4#include <stdlib.h>
5
6int main()
7{
8
9 /* Enter your code here. Read input from STDIN. Print output to STDOUT */
10 char ch;
11 char s[100];
12 char p [100];
13 scanf("%c", &ch);
14 scanf("%s", s);
15 scanf("\n");
16 scanf("%[^\n]%*c", p);
17
18 printf("%c \n", ch);
19 printf("%s \n", s);
20 printf("%s", p);
21 return 0;
22}
23
1#include <stdio.h>
2
3int main(){
4 char name[20];
5
6 printf("Enter a name : ");
7 fgets(name, 20, stdin); // fgets(variable_storing_to, accepted_input_size, stdin)
8
9 printf("the name entered is: %s\n", name);
10
11return 0;
1#include <stdio.h>
2
3int main () {
4 char str1[90], str2[90];
5
6 printf("Enter name: \n");
7 scanf("%s", str1);
8
9 printf("Enter your website name: \n");
10 scanf("%s", str2);
11
12 printf("Entered Name: %s\n", str1);
13 printf("Entered Website:%s\n", str2);
14
15 return(0);
16}