started assignment and added programs

This commit is contained in:
2025-05-08 00:28:02 +09:00
parent 3ff7ace93a
commit 8912215a06
14 changed files with 130 additions and 102 deletions

10
programs/p25/info.json Normal file
View 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
View 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;
}