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 polymorphism & list its types in c++?

0 Answers  


What is c++ redistributable?

0 Answers  


What is problem with Runtime type identification?

2 Answers  


Const char *p , char const *p What is the difference between the above two?

0 Answers   TCS,


what is polymorphism?

14 Answers   Accenture,






What is the full name of logo?

0 Answers  


If dog is a friend of boy, and terrier derives from dog, is terrier a friend of boy?

0 Answers  


Difference between struct and class in terms of access modifier.

0 Answers  


How would you implement a substr() function that extracts a sub string from a given string?

0 Answers  


Is multimap sorted c++?

0 Answers  


Which is better c++ or java?

0 Answers  


Is it possible for a member function to delete the pointer, named this?

0 Answers  


Categories