write the program for prime numbers?
Answer Posted / adhiyamaan
#include<stdio.h>
#include<conio.h>
{
int num,i;
printf("enter the number:");
scanf("%d",&num);
for(i=2;i<=num-1;i++)
{
if(num%i==0)
{
printf("NOT PRIME");
break;
}
}
if(i==num)
{
printf("PRIME");
}
getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Explain what are multibyte characters?
What are conditional operators in C?
Is boolean a datatype in c?
What is the most efficient way to count the number of bits which are set in an integer?
How does free() know explain how much memory to release?
What is the right type to use for boolean values in c?
What is string function c?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
In a switch statement, explain what will happen if a break statement is omitted?
What is structure in c explain with example?
What is the purpose of the preprocessor directive error?
How many levels of indirection in pointers can you have in a single declaration?
Why does everyone say not to use gets?
Explain what is the stack?
Is c still relevant?