Answers for "how would u give string as input in c?"

1

getting string input in c

#include<stdio.h>
#include<conio.h>
void main(){
chat sam[10];
clrscr();
printf("ENTER STRING NAME :");
gets(s);
printf("STRING :%s",s);
getch();
}
Posted by: Guest on March-16-2021
0

String input in c

#include<stdio.h>

int main()
{
    char name[30];
    printf("Enter name: ");
    gets(name);     //Function to read string from user.
    printf("Name: ");
    puts(name);    //Function to display string.
    return 0;
}
Posted by: Guest on January-18-2022

Browse Popular Code Answers by Language