Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write the program for prime numbers?

Answer Posted / love

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int num, i;
printf("enrer the value");
scanf("%d",&num);
i=2;
while(i<=num-1)
{
if(num%i==0)
{
printf("not a prime");
break;
}
i++;
}
if(i==num)
printf("prime");
getch();

}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of Macro over function?

1924


What is pointer in c?

1140


What is extern variable in c with example?

947


What is volatile variable in c?

1051


What are structures and unions? State differencves between them.

1097


What is difference between && and & in c?

1042


What is boolean in c?

1032


Explain what is a 'locale'?

1013


printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions

1094


What is clrscr ()?

1055


How do you construct an increment statement or decrement statement in C?

1175


Is it valid to address one element beyond the end of an array?

1119


Is c still used?

997


What are two dimensional arrays alternatively called as?

1132


How many types of errors are there in c language? Explain

925