Answers for "how take input from user in c"

15

c user input

#include <stdio.h>
int main()
{
    char chr;
    printf("Enter a character: ");
    scanf("%c",&chr);     
    printf("You entered %c.", chr);  
    return 0;
}
Posted by: Guest on April-14-2020
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

get user input c

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

Code answers related to "how take input from user in c"

Browse Popular Code Answers by Language