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 a mutable member?

1 Answers  


What is the purpose of extern storage specifier?

0 Answers  


Search for: what is pair in c++?

0 Answers  


sir there is some problem with nokia5130c-2,when we are trying to upload movies from net then there is a error occurred"FORMAT NOT SUPPORTED" bt its all ready in 3gp format.please tell me what i do now?

2 Answers   Nokia,


What is constructor and destructor in c++?

0 Answers  






How to declaring variables in c++?

0 Answers  


What is the difference between *p++ and (*p)++ ?

0 Answers  


What is the array and initializing arrays in c++?

0 Answers  


What is object in c++ example?

0 Answers  


Why the usage of pointers in C++ is not recommended ?

0 Answers   TCS,


What causes a runtime error c++?

0 Answers  


Explain container class.

0 Answers  


Categories