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

WHAT IS THE REASON,WE USED THREE CORE CABLE INSTEAD OF THREE SINGLE CORE CABLE.

2 Answers  


What are the consequences in using existing step up transformer (primary 6.6kv/175A, secondary 480v/2405A) for step down transformer to have a 6.6kv output?

1 Answers  


how to identyfy cable sizes?

4 Answers   IAF, Mylan,


how we provide neutral earth on synchronising panel as per electrical standards?

1 Answers  


Is an SCR semi controlled device?

4 Answers   IOCL,


in our all power plant have connected in grid and grid voltage and plant voltage is same, but as per as electrical concept the power will transmit from high potential to low potential but here altough same,then how power transmit from power plant to grid.

1 Answers  


how to find insulation resistance of a generator(11kv) by theoritical formula??

1 Answers  


how do we calculate length of starting time and repeated starting of a direct online starter?

1 Answers  


what is buscoupler adopter panel????

5 Answers  


what is the power factor

13 Answers   Heidelberge Cement,


how to calculate the cable size for LT and HT power cables with detail explanation?

2 Answers   Asset Developments, Bhel,


hi sir i have load of 17.5kw in 3 phase lighting circuit which mcb i can use

3 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5086)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4453)
  • Electrical Engineering Interview Questions Electrical Engineering (16638)
  • 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)