Logo

Programming-Idioms

History of Idiom 120 > diff from v36 to v37

Edit summary for version 37 by programming-idioms.org:
[C] Doesn't seem to requie stdlib

Version 36

2019-03-29, 17:01:59

Version 37

2019-05-24, 11:31:55

Idiom #120 Read integer from stdin

Read an integer value from the standard input into variable n.

Idiom #120 Read integer from stdin

Read an integer value from the standard input into variable n.

Imports
#include <stdio.h>
#include <stdlib.h>
Imports
#include <stdio.h>
Code
int n;
scanf("%d", &n);
printf("You entered %d\n", n);
Code
int n;
scanf("%d", &n);
printf("You entered %d\n", n);