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 |
Difference between a homogeneous and a heterogeneous container
What is a protocol class?
Is c++ a dying language?
What is a Default constructor?
Explain function overloading and operator overloading.
What is the main purpose of overloading operators?
write a porgram in c++ that reads an integer and print the biggest digit in the number
What issue do auto_ptr objects address?
What is static class data?
C++ program output? Explain output of this program. #include <iostream> using std::cout; using std::cin; int main() { cout<<cout<<' '; cout<<cin; return 0; } It prints some address in hexadecimal. what is it?
What is stack unwinding?
Is there any difference between dlearations int* x and int *x? If so tell me the difference?