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 / harpreet dhillon

#include<stdio.h> \\harpreetdhillon7@gmail.com
#include<conio.h>
void main()
{
int i,n;
clrscr();
printf("enter any number which you want to check");
scanf("%d",&n);
for(i=2;i<=n-1;i++)
{
if(n%i==0)
{
printf("not a prime number\n");
break;
}
else
{
printf("prime number\n");
break;
}
}

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a program to display all prime numbers

1965


explain what is fifo?

1069


Explain the process of converting a Tree into a Binary Tree.

2666


find the sum of two matrices and WAP for it.

1138


What is dynamic memory allocation?

1335


Is it possible to use curly brackets ({}) to enclose single line code in c program?

1316


What are the valid places to have keyword “break”?

1088


What is meant by type specifiers?

1128


What is array in C

1156


Is c language still used?

977


How to Throw some light on the splay trees?

1063


Write a program with dynamically allocation of variable.

1126


What is a constant?

1059


What is a dynamic array in c?

1157


the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above

1049