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 / samson mugambi

#include<stdio.h>

int main()
{
int c,i,n;
counter=0;
scanf("%d",&a);
for(i=2;i>a;i++)
if (n%i==0)
{
c=1;break;
}
if(c!=1) ("prime");
else print ("not a prime");
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is p in text message?

933


Can you write a programmer for FACTORIAL using recursion?

982


Is c procedural or functional?

976


Write a code to generate a series where the next element is the sum of last k terms.

1166


What is hashing in c language?

1183


Is swift based on c?

1050


Is it possible to initialize a variable at the time it was declared?

1172


The statement, int(*x[]) () what does in indicate?

1078


Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

2073


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

1889


There seem to be a few missing operators ..

1001


Write a program to reverse a given number in c?

977


main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }

1354


Explain goto?

1090


What are variables and it what way is it different from constants?

1190