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
What is #define used for in c?
What does %c mean in c?
Explain how can I remove the trailing spaces from a string?
Define Spanning-Tree Protocol (STP)
Can you explain the four storage classes in C?
How can variables be characterized?
Differentiate between null and void pointers.
What’s the special use of UNIONS?
How to get string length of given string in c?
How can I open files mentioned on the command line, and parse option flags?
Can include files be nested? How many levels deep can include files be nested?
c language interview questions & answer
Who developed c language and when?
What is zero based addressing?
How can I sort a linked list?