Skip to content

Instantly share code, notes, and snippets.

@pineapplehunter
Last active April 24, 2022 15:12
Show Gist options
  • Save pineapplehunter/07a0d1655390fffaf717e6a55527cc5e to your computer and use it in GitHub Desktop.
Save pineapplehunter/07a0d1655390fffaf717e6a55527cc5e to your computer and use it in GitHub Desktop.
C言語のデバッグ教材
#include <stdio.h>
int main() {
// a=5,b=3のとき
// c=a+bは8になってほしい!
int a = 5;
int b = 3;
int c = a - b;
if (c == 8) {
printf("成功! c = 8\n");
} else {
printf("失敗... c = 8\n");
}
// array の3要素目を表示(3と表示されてほしい)
int array[3] = {1, 2, 3};
printf("arrayの3番目の値は%dです\n", array[3]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment