write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / sathya
#include<iostream.h>
void main()
{
int n,a;
cout<<"enter the limit";
cin>>n;
for(i=1;i<=n;i++}
{
if(i=1)
{
cout<<"1 is neither a prime nor a composite no";
}
else if(i%1==0|i%i==0)
{
cout<<i<<"is a prime number";
}
}
}
Is This Answer Correct ? | 63 Yes | 165 No |
Post New Answer View All Answers
When is the “void” keyword used in a function?
What are the 4 data types?
Explain union.
What is the difference between class and object in c?
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
What are the various types of control structures in programming?
What header files do I need in order to define the standard library functions I use?
What are the types of functions in c?
What is pointer & why it is used?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
Explain what is a pragma?
What is volatile keyword in c?
What is array in C
How is a null pointer different from a dangling pointer?
Explain what is the stack?