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
I have seen function declarations that look like this
Why do we write return 0 in c?
What is putchar() function?
List a few unconditional control statement in c.
When should the volatile modifier be used?
How arrays can be passed to a user defined function
What is wrong in this statement? scanf(ā%dā,whatnumber);
How do we make a global variable accessible across files? Explain the extern keyword?
What are the types of data types and explain?
Why main function is special give two reasons?
Write the syntax and purpose of a switch statement in C.
Where is c used?
Tell me about low level programming languages.
Explain what are multidimensional arrays?
Do character constants represent numerical values?