Please write me a program to print the first 50 prime
numbers (NOT between the range 1 -50)
Answer Posted / antony
#include<stdio.h>
void main()
{
int count=0;
int num=1;
int i;
printf("prime nums \n");
while(count<50)
{
num++;
for (i=2;i<=num-1;i)
{
if(num%i==0)break;
i++;
}
if(i>=num-1)
{
printf("%d ",num);
count++;
}
}
}
| Is This Answer Correct ? | 93 Yes | 47 No |
Post New Answer View All Answers
What are different types of variables in c?
Describe the difference between = and == symbols in c programming?
Why is c used in embedded systems?
Explain what is the benefit of using enum to declare a constant?
Why does notstrcat(string, "!");Work?
How do you list files in a directory?
What is structure of c program?
What will the preprocessor do for a program?
What is the difference between struct and union in C?
How many loops are there in c?
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon
Is swift based on c?
How many header files are in c?
What is boolean in c?
What is %lu in c?