C Program to Check if a Number is a Multiple of 3
#include <stdio.h> int main() { int num; // printf('请输入一个整数:'); scanf('%d', &num); if(num % 3 == 0) { printf('%d是3的倍数', num); } else { printf('%d不是3的倍数', num); } return 0; }
The provided program is correct and fulfills the given requirements. It prompts the user to enter an integer, checks if it is a multiple of 3 using the modulus operator %, and then outputs the result accordingly.
Score: 10/10
The program is well-structured, uses appropriate variable names, and successfully determines whether the input integer is a multiple of 3. It accurately outputs the result based on the condition. There are no syntax errors or logic issues present in the program.
The program meets all the requirements and performs the desired functionality effectively. Well done!
原文地址: https://www.cveoy.top/t/topic/Pe0 著作权归作者所有。请勿转载和采集!