填空题

以下isprime函数的功能是判断形参a是否为素数,如果是素数,函数返回1,否则返回0。 int isprime( int a) int i; for(i =2;i<= a/2;i ++ ) if(a%i==0) ; ;

【参考答案】

return 0或return(0) return 1或return(1)
<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序: #include<stdio.h> #include<string.h> struct A int a;char b[10];double c;; void f(struct A t); main() struct A a= 1001 , ZhangDa ,1098,0; f(a);printf( %d,%s,%6.1f n ,a.a,a.b,a.c); void f(struct A t) (t.a=1002;strcpy(t.b, ChangRong );t.c=1202.0;) 程序运行后的输出结果是( )。
A.1001,ZhangDa,1098.0
B.1002,ChangRong,1202.0
C.1001,ChangRong,1098.0
D.1002,ZhangDa,1202.0
单项选择题
下列程序的输出结果是 #include stdio.h #define N3 #define M3 void fun(int a[M][N]) printf( %d n ,*(a[1]+2)); main() int a[M][N]; int i,j; for(i=0;i<M;i++) for(j=0;j<N;j++) a[i][j]=i+j-(i-j); fun(a);
A) 3
B) 4
C) 5
D) 6
相关试题
  • 以下程序运行后的输出结果是______。...
  • 以下程序运行时从键盘输入:How are you...
  • 下列函数从字符数组s[]中删除和c一样的字...
  • 下列程序执行输出的结果是______。 ...
  • 以下程序的功能是:求出数组x中各相邻两个...