Answers for "get string from user in c"

1

how to get user input in c

#include <stdio.h>
//this is for storing numbers
int main(){
	
    int age; //this makes a vairable for you to store the value in
    printf("enter in your age: "); //this prints a prompt for the user
    scanf("%d", &age); //this takes in the argument given and stores it
                       //into the address of age

	return 0;
}
Posted by: Guest on June-07-2020
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

how to get string input in c

#include <stdio.h>

int main () {
   char str1[90], str2[90];

   printf("Enter name: n");
   scanf("%s", str1);

   printf("Enter your website name: n");
   scanf("%s", str2);

   printf("Entered Name: %sn", str1);
   printf("Entered Website:%sn", str2);
   
   return(0);
}
Posted by: Guest on July-07-2021
1

get user input c

int c;
printf( "Enter a value :");
c = getchar( );
Posted by: Guest on June-30-2020

Code answers related to "get string from user in c"

Browse Popular Code Answers by Language