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...

check whether a no is prime or not.

Answer Posted / paramjeet singh

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i,c;
printf("enter any number\n");
scanf("%d",&i);
printf("you have entered=%d\n",i);
for(c=2;c<=i-1;c++)
{
if(i%c==0)
printf("this no.is not a prime number");
}
printf("this is prime number");
getch();
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between multiple and multilevel inheritance in c++?

1134


Name four predefined macros.

1047


Explain container class.

1257


What is the limitation of cin while taking input for character array?

2087


How would you find out if a linked-list is a cycle or not?

1009


Why is main an int?

997


When is dynamic checking necessary?

1131


How much is c++ certification?

1059


Why do we learn c++?

978


What are the important differences between c++ and java?

1158


Can we sort map in c++?

1020


Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;

2017


What is the best c++ ide?

1178


What is this pointer in c++?

1412


What is a manipulator in c++?

1239