wap to accept 10 numbers & display the number of odd and
even numbers??
Answer Posted / 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 |
Post New Answer View All Answers
What is setfill c++?
which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?
What can I use instead of namespace std?
What is the use of data hiding?
What is c++ similar to?
Can we make copy constructor private in c++?
What is heap sort in c++?
What does override mean in c++?
What does floor mean in c++?
How many types of classes are there in c++?
Difference between inline functions and macros?
What is #include cstdlib in c++?
Why main function is special in c++?
Can you help me with this one? Make a program that when a user inputed a Product Name, it will display its price, and when the user inputed the quantity of the inputed product, it will show its total price. The output must be like this: Product Name: Price: Quantity: Total Price: ..this is the list of products to be inputed: Cellphone - 1500 Washing Machine - 5200 Television - 6000 Refrigirator - 8000 Oven - 2000 Computer - 11000 thanks..:D
What is meant by entry controlled loop?