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
Explain zero based addressing.
What is call by reference in functions?
Can static variables be declared in a header file?
What does 3 mean in texting?
develop algorithms to add polynomials (i) in one variable
How can I write a function analogous to scanf?
How do you sort filenames in a directory?
Explain heap and queue.
2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier. Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed. When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed. Sequence of take-off is the sequence of addition to the waitlist
Write a program in c to replace any vowel in a string with z?
How arrays can be passed to a user defined function
What is keyword in c?
How can you invoke another program from within a C program?
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
Is boolean a datatype in c?