write the program for prime numbers?
Answer Posted / pritam neogi
#include<stdio.h>
#include<conio.h>
void main()
{
int no,i,count=0;
clrscr();
printf("enter the no");
scanf("%d",&no);
for(i=1;i<=no;i++)
{
if(no%i==0)
{
count=count+1;
}
}
if(count<=2)
{
printf("this is prime no");
}
else
{
printf("this is not prime");
}
getch();
}
| Is This Answer Correct ? | 32 Yes | 16 No |
Post New Answer View All Answers
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above
Can you explain what keyboard debouncing is, and where and why we us it? please give some examples
What is the scope of static variable in c?
Discuss the function of conditional operator, size of operator and comma operator with examples.
How can I handle floating-point exceptions gracefully?
What is the basic structure of c?
What does stand for?
What is the need of structure in c?
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
What is c definition?
Simplify the program segment if X = B then C ← true else C ← false
if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
Differentiate between Macro and ordinary definition.