technicalsymposium

Google Search-Search in Our Website

Search Freshers Jobs/Conferences/Placement Materials/ All Engineering Branches Lecture Notes and
GATE/All Universities Question Papers in Our Website. Enter your Query & Search Below

Programming Codes with Answers

PRIME NUMBER FINDING

#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,c=0,j,a,b;
clrscr();
printf("Enter any number:");
scanf("%d%d",&a,&b);
for(i=a;i<=b;i++)
{
c=0;
for(j=1;j<=i;j++)
{
if(i%j==0)
{
c++;
//printf("i=%d and j=%d and c=%d\n",i,j,c);
}
}
if(c==2)
{
printf("%d\n",i);
}
}
getch();
}

Hosting by Yahoo!

About-Us    Contact-Us    Site-map

©copyright 2009 All rights are reserved to technicalsymposium.com