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 is volatile variable how do you declare it?
Once I have used freopen, how can I get the original stdout (or stdin) back?
design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.
what is the basis for selection of arrays or pointers as data structure in a program
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.
What is a lookup table in c?
What do you know about the use of bit field?
what are enumerations in C
What's a good way to check for "close enough" floating-point equality?
What is the correct declaration of main?
What was noalias and what ever happened to it?
what is stack , heap ,code segment,and data segment
What is logical error?
What is self-referential structure in c programming?
What does printf does?