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

Difference between pointer to constant and constant pointer to a constant. Give example.

0 Answers   HAL,


Will this c++ program execute or not?

0 Answers  


what are the decision making statements in C++? Explain if statement with an example?

0 Answers  


Which software is best for c++ programming?

0 Answers  


What is the use of structure in c++?

0 Answers  


What will happen if when say delete this ?

7 Answers  


What is the exit function in c++?

0 Answers  


Explain unexpected() function?

0 Answers  


What is scope resolution operator in c++ with example?

0 Answers  


Which software is used for c++ programming?

0 Answers  


What is copy constructor? Can we make copy constructor private in c++?

0 Answers  


Why is main an int?

0 Answers  


Categories