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
What does the c in ctime mean?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
Can you please compare array with pointer?
Do you have any idea how to compare array with pointer in c?
Is javascript written in c?
Is there any data type in c with variable size?
What is the difference between ++a and a++?
What is array within structure?
How can I ensure that integer arithmetic doesnt overflow?
Why do we use null pointer?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
Do array subscripts always start with zero?
Why is c known as a mother language?
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.