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

Write a program to print fibonacci series without using recursion?

1150


Describe the difference between = and == symbols in c programming?

1384


How will you write a code for accessing the length of an array without assigning it to another variable?

1059


What is structure in c definition?

1062


How main function is called in c?

1134


what is use of malloc and calloc?

1910


Write a program to swap two numbers without using the third variable?

1078


What are the different types of constants?

1079


Write a program to reverse a linked list in c.

1141


What is the size of structure in c?

1161


In which layer of the network datastructure format change is done

1894


What is a void pointer in c?

1114


Explain what is a const pointer?

1091


Explain void pointer?

1055


What is a structure in c language. how to initialise a structure in c?

1067