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 a nested formula?
List some of the static data structures in C?
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
What is a MAC Address?
What is the use of the function in c?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
What are the advantages of using linked list for tree construction?
write a proram to reverse the string using switch case?
Why c is a mother language?
What is wrong with this declaration?
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
What is the best style for code layout in c?
How can I invoke another program or command and trap its output?
Why is %d used in c?
Using which language Test cases are added in .ptu file of RTRT unit testing???