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
What does %p mean c?
What is the difference between call by value and call by reference in c?
Is c procedural or functional?
What is pragma in c?
How will you find a duplicate number in a array without negating the nos ?
Explain about the functions strcat() and strcmp()?
what do you mean by enumeration constant?
#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }
Does c have function or method?
In a header file whether functions are declared or defined?
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
Is there any demerits of using pointer?
What are the 5 types of organizational structures?
What is the full form of getch?