الأجوبة
/*Write a C program to determine whether a given number is prime or not*/
#include <stdio.h>
void main(){
int num,i,ctr=0;
printf("Input a number: ");
scanf("%d",&num);
for(i=2;i<=num/2;i++){
if(num % i==0){
ctr++;
break;
}
}
if(ctr==0 && num!= 1)
printf("%d is a prime number.\n",num);
else
printf("%d is not a prime number",num);
}القوائم الدراسية التي ينتمي لها السؤال