write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / santhi perumal
#include<Stdio.h>
#include<conio.h>
int main()
{
int i,j, flag = 0;
for(i=2;i<=100;i++)
{
for(j=2;j<i;j++)
{
if(i != j)
{
if(i%j != 0)
continue;
else
break;
}
}
if(i == j)
printf("%d ",i);
}
}
| Is This Answer Correct ? | 52 Yes | 38 No |
Post New Answer View All Answers
Explain how can I open a file so that other programs can update it at the same time?
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
Why header file is used in c?
Why is c fast?
What is the ANSI C Standard?
Explain how do you list files in a directory?
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
Is flag a keyword in c?
Write a program to generate random numbers in c?
i want to know the procedure of qualcomm for getting a job through offcampus
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
What is const and volatile in c?
Explain about block scope in c?
Difference between macros and inline functions? Can a function be forced as inline?
How will you divide two numbers in a MACRO?