Programming 7

This program enables a user to input a value and evaluates whether the number is a multiple of 3.





Source code:
#include <stdio.h>

int main(void)
{
int a;

puts("3の倍数かを判定します");
puts("数字を入力してください");
scanf("%d", &a);

if(a%3)
printf("%dは3の倍数じゃないです", a);
else
printf("%dは3の倍数です", a);

return(0);
}

0 件のコメント:

コメントを投稿