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 / karthika

#include<stdio.h>
#include<conio.h>
void main()
{
int num,i=2;
clrscr();
printf("\n entert a number");
scanf("%d",&num);
while(c<=num-1)
{
if(num%i==0)
{
printf("given number is not a prime number\n");
break;
}
i++;
}
if(i==num);
printf(given number is a prime number\n");
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 does a function declared as pascal do differently?

1142


What are the advantages of c language?

1099


Disadvantages of C language.

1110


Why we use int main and void main?

1086


What is the code in while loop that returns the output of given code?

2001


Can we replace the struct function in tree syntax with a union?

1315


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

2083


List out few of the applications that make use of Multilinked Structures?

2201


Which programming language is best for getting job 2020?

1055


Explain how can you check to see whether a symbol is defined?

1210


Why void main is used in c?

1056


What is the purpose of ftell?

1090


What does p mean in physics?

1049


Describe explain how arrays can be passed to a user defined function

1113


What is the value of uninitialized variable in c?

1035