wap to print prime number from 1 to 100 using c++



wap to print prime number from 1 to 100 using c++..

Answer / digvijay ghildiyal

#include<iostream.h>
#include<conio.h>
void main()
{
int x,c,i;
clrscr();
cout<<"\n";
for(i=1;i<=100;i++)
{c=0;
for(x=1;x<=i;x++)
{
if(i%x==0)
c++;
}
if(c==2)
cout<<"\n"<<i;
}
getch();
}

Is This Answer Correct ?    16 Yes 10 No

Post New Answer

More Electrical Engineering Interview Questions

volts=230 c=10mf a=??

0 Answers  


NOW A DAYS THE POWER SUPPLY IS VERY LOW.SO THE FLURESCENT TUBE LIGHTS ARE VERY DIM.IS THERE IS ANY WAY TO INCREASE ITS BRIGHTNESS?FOR EXAMPLE ANY CONVERTER,CONDENSER?

1 Answers   Bhel,


What is the difference between earthing & neutral.

2 Answers  


What is the suitable rating of MCB for 1.5 Ton A.C and why? 1Ton= how many amperes?

5 Answers   BARC,


how to calculate the bus-bar size. give formula with description

1 Answers  






Where the ON LOAD TAP CHANGER is provided in the setp up transformer?

2 Answers  


how to find out speed of single phase motor

6 Answers   BARC,


When a fourth resistor is connected in series with three resistors, the total resistance

1 Answers   ITI,


Why current leads the voltage in case of capacitor load? Why voltage leads the current in case of inductive load? Why both are with in phase in case of restive load?

3 Answers   TATA,


we use capister for power factor. when we use capaciter in dg circuit  than defect dg. can we use capaciter bank for dg circuit

0 Answers   Syncom,


What is the use for cable entry in control room?

0 Answers  


6.6Kv feeder feeding tow step down transformers-415V-,what the possible consideration for parrellel operation?

1 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4451)
  • Electrical Engineering Interview Questions Electrical Engineering (16632)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)