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 / oza priyanka

#include<stdio.h>
void main()
{
int num,i,cnt;
clrscr();
printf("\n\nEnter the number = ");
scanf("%d",&num);
for(i=2,cnt=0;i<num;i++)
{
if(num%i==0)
cnt=1;
}
if(cnt==0)
printf("\n\nprime number");
else
printf("\n\n not a prime number");
getch();
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of functions in c?

988


what is event driven software and what is procedural driven software?

2576


Write a code to remove duplicates in a string.

1037


What is the size of a union variable?

1053


What is the use of ?

1042


Is null always defined as 0(zero)?

1113


Explain how can you be sure that a program follows the ansi c standard?

1478


What are variables c?

1053


What are the advantages of Macro over function?

2023


How does placing some code lines between the comment symbol help in debugging the code?

996


What is class and object in c?

1122


List the difference between a "copy constructor" and a "assignment operator"?

1018


Where is c used?

1094


Write a program in c to replace any vowel in a string with z?

1128


Do you know the purpose of 'register' keyword?

1021