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

Explain what is operator promotion?

1147


What is struct node in c?

1123


Explain the use of keyword 'register' with respect to variables.

1096


What is scanf_s in c?

1167


where are auto variables stored? What are the characteristics of an auto variable?

1101


Why c language is called c?

1061


What are the types of type specifiers?

1095


What is the use of a ‘’ character?

1142


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

1224


Find MAXIMUM of three distinct integers using a single C statement

1113


How will you delete a node in DLL?

1338


What is indirection?

1150


What is the difference between ++a and a++?

1271


What are the two forms of #include directive?

1218


Write a program to generate random numbers in c?

1153