clanguage07@gmail.com

clanguage07@gmail.com

Saturday, June 16, 2012

TO find sum of prime numbers.

#include<stdio.h>
#include<conio.h>
void main()
{
     int n,i,count,j;
     clrscr();
     printf("enter the number:");
     scanf("%d",&n);
     printf("the prime number below%d are:",n);
     for(i=1;i<=n;i++)
     {
     count=0;
     for(j=1;j<=i;j++)

     if(i%j==0)
     count++;
     if(count==2)
     printf("\t%d",i);
     }
     getch();
     }

No comments:

Post a Comment

GET MORE INFORMATION

http://ads.qadservice.com/t?id=c2168e05-8974-4816-872a-91936ff7379d&size=1024x768&drct=true