write the program for prime numbers?
Answer Posted / love
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int num, i;
printf("enrer the value");
scanf("%d",&num);
i=2;
while(i<=num-1)
{
if(num%i==0)
{
printf("not a prime");
break;
}
i++;
}
if(i==num)
printf("prime");
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How can you access memory located at a certain address?
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
What is the benefit of using #define to declare a constant?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
I heard that you have to include stdio.h before calling printf. Why?
Explain what is dynamic data structure?
why programs in c are running with out #include
Explain what are the different file extensions involved when programming in c?
Can a variable be both static and volatile in c?
what is the different bitween abap and abap-hr?
What are dangling pointers? How are dangling pointers different from memory leaks?
What are enumerated types?
In which header file is the null macro defined?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
What are pointers? Why are they used?