wap to accept 10 numbers & display the number of odd and
even numbers??
Answer / suman_kotte
void main()
{
int a[10],i,even=0,odd=0;
cout<<"enter 10 num's";
for(i=1;i<=10;i++)
{
cin>>a[i];
}
for(i=1;i<=10;i++)
{
if(a[i]%2==0)
even++;
else
odd++;
}
cout<<"the num of even num"<<even;
cout<<"the num of odd num"<<odd;
}
| Is This Answer Correct ? | 17 Yes | 1 No |
How do you write a function that can reverse a linked-list?
What is meant by a delegate?
Brief explaination about #include<iostream.h>, cin and cout
What is a type library?
find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.
What is object in c++ example?
When is dynamic checking necessary?
how many rounds and wt type of questios ask in the written test for first round 2. tech. round 3. and futher rounds
How do you decide which integer type to use?
What does #define mean in c++?
Give the difference between the type casting and automatic type conversion. Also tell a suitable C++ code to illustrate both.
What is #include cstdlib in c++?