整数値 15 から 37 を引いた値を表示する
明解C言語 入門編 > 1. まずは慣れよう >
整数値 15 から 37 を引いた値を表示する
C
#include <stdio.h>
int main(int argc, char* argv[])
{
printf("%d", 15 - 37);
return 0;
}
実行結果
R:\>lesson001\project1.exe
-22
C++
#include <iostream.h>int main(int argc, char* argv[])
{
cout << 15 - 37;return 0;
}
実行結果
T:\>lesson001\project1.exe
-22
Delphi
program Project1;{$APPTYPE CONSOLE}
uses
SysUtils,
begin
write(format('%d', [15 - 37]));
end.
実行結果
S:\>lesson001\project1.exe
-22