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

#include<stdio.h>
#include<conio.h>
{
int num,i;
printf("enter the number:");
scanf("%d",&num);
for(i=2;i<=num-1;i++)
{
if(num%i==0)
{
printf("NOT PRIME");
break;
}
}
if(i==num)
{
printf("PRIME");
}
getch();
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is #define used for in c?

1062


What does %c mean in c?

1086


Explain how can I remove the trailing spaces from a string?

1048


Define Spanning-Tree Protocol (STP)

1129


Can you explain the four storage classes in C?

1119


How can variables be characterized?

2186


Differentiate between null and void pointers.

1166


What’s the special use of UNIONS?

1152


How to get string length of given string in c?

1067


How can I open files mentioned on the command line, and parse option flags?

1070


Can include files be nested? How many levels deep can include files be nested?

1158


c language interview questions & answer

1958


Who developed c language and when?

1064


What is zero based addressing?

1171


How can I sort a linked list?

1049