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 a program to find the given number is prime or not

Answers were Sorted based on User's Feedback



write a program to find the given number is prime or not..

Answer / alex

here is answer
http://www.prepjunk.com/151/program-to-find-the-given-number-is-prime-or-not

Is This Answer Correct ?    2 Yes 0 No

write a program to find the given number is prime or not..

Answer / rabindra nath das

#include<stdio.h>
#include<conio.h>
void main()
int n,k,fl=0,r;
clrscr();
printf("\n Enter the number==>>");
scanf("%d",&d);
for(k=2;k<=n/2 && fl==0;k++)
{
r=n%k;
if(r==0);
fl=1;
}
if(fl==0)
printf("\n %d is a prime number",n);
else
printf("\n %d is not prime number",n);
getch();
}

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More C Interview Questions

main() { int arr[5]={23,67}; printf("%d%d%d",arr[2],arr[3],arr[4]); }

9 Answers   TCS,


write a program to print the all 4digits numbers & whose squares must me even numbers?

2 Answers   Virtusa,


In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping

0 Answers  


What is conio h in c?

0 Answers  


Difference between data structure and data base.

7 Answers   CTS, Value Labs, Zoho,


What is a symbolic constant?

1 Answers  


What is the meaning of int *x[]();?

1 Answers  


implement OR gate without using any bitwise operator.

1 Answers   Alcatel, Wipro,


What is the size of array float a(10)?

0 Answers  


Is malloc memset faster than calloc?

0 Answers  


write a program in c to print **** * * * * ****

1 Answers   TCS,


while running a program, i got the msg that press return key to exit.what that mean in C as there are no such options as far i know.

1 Answers   TCS,


Categories