C語言判斷一個數能否被3和5整除


#include <stdio.h>
/*
判斷一個數能不能同時被3和5整除
--------soulsjie 20170525-----
*/
void main(){
        int input;
        printf("請輸入一個數:");
        scanf("%d",&input);
        if(input%3==0 && input%5==0)
        {
            printf("%d能同時被3和5整除!\n",input);
        }
        else{printf("%d不能同時被3和5整除",input);}

}

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM