C语言算法中,判断一个数是素数?要程序
问题描述:
C语言算法中,判断一个数是素数?要程序
答
/*To judge whether a number 'n' is prime number or not*/#include#includeint main(){int n,i,k,prime=1;do{printf("Please input a positive number:\nn=");scanf("%d",&n);}while(n