write the program for prime numbers?
Answer Posted / chetan mehra
#include<stdio.h>
#include<conio.h>
void main()
{
int x,y,z;
clrscr();
for(x=2; x<=50; x++)
{
for(y=2; y<x; y++)
{
if(x%y==0)
{
break;
}
}
if(x==y){
printf("%d\n",y);
}
}
getch();
}
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How is a macro different from a function?
What is #define size in c?
Can a function argument have default value?
Is fortran still used in 2018?
Is it cc or c in a letter?
main() { printf("hello"); fork(); }
What are the advantages of c language?
How can a process change an environment variable in its caller?
What is a protocol in c?
Explain the use of #pragma exit?
Why is c used in embedded systems?
Write a program to print numbers from 1 to 100 without using loop in c?
What's the total generic pointer type?
What are directives in c?
Describe the difference between = and == symbols in c programming?