write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / nikhil
#include<stdio.h>
#include<conio.h>
void main()
{
int m,flag;
flag=0;
for(int i=2;i<100;i++)
{
for(int j=1;j<i;j++)
{
if(i%j==0)
{flag++;
}
}
if(flag==2)
{printf("it is prime %d",i);
}
}
getch();
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is the mean of function?
What are the 5 data types?
What is indirection in c?
What is main return c?
Explain high-order and low-order bytes.
What are the two types of structure?
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
What are the characteristics of arrays in c?
Why header file is used in c?
Explain the use of fflush() function?
What is sizeof int in c?
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
What is a c token and types of c tokens?
What is strcpy() function?
What is I ++ in c programming?