以下程序可判断输入的一个整数是否能被3或7整除,若能整除,输出“yes”,否则输出“no”。请填空。#include “stdio.h” #include “stdio.h” void main() { int k; printf(“Enter a int number:”); scanf(“%d”,______); if(_____) printf(“yes\n”); else printf(“no\n”); }
举一反三
- 下程序的功能是判断输入的一个整数是否能被3或7整除,若能整除,输出YES,否则输出NO。在下划线处应填入的选项是( ) #include main() { int k; printf("Enteraintnumber:");scanf("%d",&k); if ________ printf("YES"); else printf("NO"); }
- /*【程序填空】题目:编程判断一个整数x能否同时被3和5整除。*/#include "stdio.h"main(){/***********SPACE***********/ 【?】 x; /***********SPACE***********/ scanf("%d",【?】);/***********SPACE***********/ if(x%3==0【?】) printf("YES\n");/***********SPACE***********/ 【?】 printf("NO\n"); }
- 以下程序可判断输入的一个字符是否为小写字母,如果是,则转换为对应的大写字母并输出;否则,就原样输出。请填空。 #include “stdio.h” void main() { char k; printf(“Enter a character here:”); scanf(“%c”,_______); if(______=’a’ && k <______) printf(“%c\n”,k-32); else printf(“%c\n”,k); }
- 以下程序正确的是_____ A: B: include<;stdio.h>;int gNum;gNum=13;void main(){printf("%d\n", gNum);} C: D: include<;stdio.h>;void main(){int rob=17;printf("rob=%d\n", rop);}int rop=71; E: F: include<;stdio.h>;void main(){extern int outer;printf("outer=%d\n", outer);}int outer=33; G: H: include<;stdio.h>;void main(){extern int outer=33;printf("outer=%d\n", outer);}int outer=33;
- Which of the following program is right? A: include <stdio.h> int main(); { /*programming*/ printf("programming!\n"); return 0; } B: include <stdio.h> int main() { /*programming*/ printf("programming!\n"); return 0; } C: include <stdio.h> void main() { /*programming*/ printf("programming!\n") return 0; } D: include <stdio.h> int mian() { /*programming*/ printf("programming!\n"); return 0; }