prime number(2.3.5.7.11.13.......)
prime number(2.3.5.7.11.13.......)repeat input number from keyboard until number is 0;
check that number is prime number or not.
If it is prime number,sum all of them
gaoshou , bangmang xia le !!!!!!!
#include<stdio.h> main() { int i,k,n,sum=0; printf("Input number:i\n"); scanf("%d",&i); while(i!=0) { printf("i=%3d\n",i); if (i>0&&i<=2) sum=sum+i; else { for(n=2;n<=i-1;n++) { k=i%n; if(k==0) break; else sum=sum+i; }} scanf("%d",&i); } printf("sum=%d\n",sum); }hope that can help you