started assignment and added programs
This commit is contained in:
10
programs/p25/info.json
Normal file
10
programs/p25/info.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"language": "C",
|
||||
"name": "演習課題1 演習2ー5",
|
||||
"description": "2つの整数値を読み込み、前者の値が後者の値の何%であるかを倍精度浮動小数点数として表示するプログラム。",
|
||||
"output": {
|
||||
"type": "screenshot",
|
||||
"content": "./assets/p25.png"
|
||||
},
|
||||
"note": ""
|
||||
}
|
||||
14
programs/p25/main.c
Normal file
14
programs/p25/main.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int a, b;
|
||||
|
||||
printf("Integer a: ");
|
||||
scanf("%d", &a);
|
||||
printf("Integer b: ");
|
||||
scanf("%d", &b);
|
||||
|
||||
printf("Value of a is %f%% of b.\n", (double)a / (double)b * 100.0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user