write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / pravin
#include<iostream>
using namespace std;
int main()
{
int num,i,j,flag;
cout<<"enter the no. up2 which u want prime no's:";
cin>>num;
for(i=2;i<=num;i++)
{
flag=1;
for(j-2;j<i/2;i++)
{
if(i%j==0)
flag=0;
}
if(flag==1)
cout<<i<<" ";
}
}
| Is This Answer Correct ? | 34 Yes | 22 No |
Post New Answer View All Answers
How do you list files in a directory?
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
What is a static variable in c?
What is the meaning of typedef struct in c?
What is meant by keywords in c?
Explain the concept and use of type void.
WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..
How can I recover the file name given an open stream?
define string ?
write a program to find out prime number using sieve case?
What is file in c preprocessor?
What is c system32 taskhostw exe?
What standard functions are available to manipulate strings?
What is the acronym for ansi?
What is difference between static and global variable in c?