Monday, April 1, 2013

Write a C program to check whether a given number is prime or ...

2:45 AM

C program to find prime numbers



#include<stdio.h>

int main(){

int num,i,count=0;
printf("Enter a number: ");
scanf("%d",&num);
for(i=2;i<=num/2;i++){
if(num%i==0){
count++;
break;
}
}
if(count==0 && num!= 1)
printf("%d is a prime number",num);
else
printf("%d is not a prime number",num);
return 0;
}


output:


Enter a number: 11


11 is a prime number





-----------------------------------------------


Write a C++ program to find prime numbers between  answers .Write a C Program to check number is Prime number . How can you write a program that will determine if the.Program to print first n prime numbers in c.?


C program to determine prime number. Determining if a number is prime in c. C program to find given number is prime or not

Written by

We are one of the initiators of the development of information technology in understanding the need for a solution that is familiar and close to us.

0 comments:

Post a Comment

 

© 2013 Klick Dev. All rights resevered.

Back To Top