write a C++ programming :if the no is between 32 to 50 it
will be odd.

Answers were Sorted based on User's Feedback



write a C++ programming :if the no is between 32 to 50 it will be odd...

Answer / amit

void main()
{

int i,r;
for(i=32;i<=50;i++)
{
if(i%2!=0)
{
cout<<"odd"<<i
}
}

getch();
}

Is This Answer Correct ?    11 Yes 1 No

write a C++ programming :if the no is between 32 to 50 it will be odd...

Answer / debotri das

#include<iostream.h>
#include<conio.h>
void main()
{
int i=32;
clrscr();
while(i<=50)
{
if(i%2==0)
cout<<i<<"\n";
i++;
}
getch();
}

Is This Answer Correct ?    8 Yes 1 No

write a C++ programming :if the no is between 32 to 50 it will be odd...

Answer / devi

#include<iostream.h>
#include<conio.h>
void main()
{
int i;
clrscr();
for(i=32;i<=50;i++)
{
if(i%2==1)
{
cout<<"Odd Number is:"<<i<<endl;
}
}
getch();
}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C++ General Interview Questions

What is data type in c++?

0 Answers  


State two differences between C and C++.

0 Answers   Hexaware,


program explaining feautures of c++

0 Answers   Satyam,


What information can an exception contain?

0 Answers  


why all c++ program must have default constructor?

6 Answers   IBM,






What is the most useful programming language?

0 Answers  


What is c++ hiding?

0 Answers  


Can c++ be faster than c?

0 Answers  


C is to C++ as 1 is to a) What the heck b) 2 c) 10

0 Answers  


What is null pointer and void pointer?

0 Answers  


Does std endl flush?

0 Answers  


What is guard code in c++?

0 Answers  


Categories