Skip to content

Instantly share code, notes, and snippets.

@milk19873
Created October 2, 2016 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milk19873/e69b7e0062e5154225c852a315d92df8 to your computer and use it in GitHub Desktop.
Save milk19873/e69b7e0062e5154225c852a315d92df8 to your computer and use it in GitHub Desktop.
/*
* C言語のサンプルプログラム - Webkaru
* - 入力した2つの整数を足し算・引き算 -
*/
#include <stdio.h>
int main(void)
{
int a, b;
/* 2つ整数を入力 */
printf("1つ目の整数: a = ");
scanf("%d", &a);
printf("2つ目の整数: b = ");
scanf("%d", &b);
/* 足し算の計算・出力 */
printf("a + b = %d\n", a+b);
/* 引き算の計算・出力 */
printf("a - b = %d\n", a-b);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment