How do you make User Inputs?

0 votes
asked Apr 21, 2019 by anonymous
I am a new programmer with C and am stumped on how to make a user input. Could someone please tell me how?

2 Answers

0 votes
answered Apr 22, 2019 by anonymous
if you are asking about getting an input from user (using terminal window) it looks something like this:

int input;

scanf("%d",&input); //this statement will get an input from user and store into variable input with type int. hope this helped
0 votes
answered Apr 23, 2019 by Matthew Green (260 points)

Try something like this

#include<stdio.h>

void main()

{

int a;

scanf("%d",&a);

}

You need to declare an integer and then write the scanf code corresponding to it

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...