Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Program does not respond to input (Beginner)

$
0
0
Hello peeps. I'm learning C in my programming class and I'm a beginner. I'm trying to do a simple program where the user enters a number, then the program spits it back out. But for some reason when I enter the number and hit enter, nothing happens.

Here's my code:


int main(void){
	int i, k;

	printf("Enter some number: \n");
	scanf("%d", &i);
	printf("%d\n", i);
	printf("Enter some other number: \n");
	scanf("%d", &k);
	printf("%d", k);
	return 0;
}




[UPDATE]

Let me clarify a bit more. Instead of printing out the first output, the program skips to waiting for the first input. When I enter the input, nothing happens.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>