write a C++ programming :if the no is between 32 to 50 it
will be odd.
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)?
What is the maximum combined length of command line arguments including the space between adjacent arguments?
What does iomanip mean in c++?
what is an array
Consider a c++ template funtion template<class T> T& Add(T a, T b){return a+b ;} if this function is called as T c = Add("SAM", "SUNG"); what will happen? What is the problem in the template declaration/ How to solve the problem.
What are the rules about using an underscore in a c++ identifier?
What is prototype for that c string function?
How many types of classes are there in c++?
Should I learn c or c++ or c#?
What is dangling pointers?and what is memory leak?
What is binary search in c++?
Can I learn c++ without knowing c?