write the program for prime numbers?
Answer Posted / noble
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("enter any number:");
scanf("%d",&a);
for(b=2;b<=a-1;b++)
{
if(a%b==0)
break;
}
if(a==b)
{
printf("%d is prime number",a);
}
else
{
printf("%d is not prime number",a);
}
getch();
}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are actual arguments?
Which is an example of a structural homology?
Is a house a mass structure?
Is fortran faster than c?
How to write a code for reverse of string without using string functions?
Why shouldn’t I start variable names with underscores?
hi send me sample aptitude papers of cts?
How do you construct an increment statement or decrement statement in C?
a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if
Write a program to reverse a given number in c?
What is call by reference in functions?
What is infinite loop?
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
When c language was developed?