[C] Integer Type Input/Output
- scanf : Formatted Read
- printf : Formatted Write
#include <stdio.h>
int main(void)
{
int a, b;
puts("-----------------------------");
puts(" ** Integer input / Output");
puts("-----------------------------");
printf(" Input : ");
scanf("%d %d", &a, &b);
printf("a=%d, b=%d \n", a, b);
return 0;
/*
-----------------------------
** Integer input / Output
-----------------------------
Input : 1 5
a=1, b=5
*/
}
#include <stdio.h>
int main(void)
{
int a, b;
puts("-----------------------------");
puts(" ** Integer input / Output");
puts("-----------------------------");
printf(" First integer : ");
scanf("%d", &a);
printf(" Second integer : ");
scanf("%d", &b);
printf("a=%d, b=%d \n", a, b);
puts("-----------------------------");
return 0;
/*
--------------------------
** Integer input / Output
-----------------------------
First integer : 1
Second integer : 2
a=1, b=2
-----------------------------
*/
}
Reference
- func.kr
- C Programming: A Modern Approach by K.N.King