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 |
Explain about profiling?
What is a null object in c++?
Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02
What size is allocated to the union variable?
What can I use instead of namespace std?
What is the use of structure in c++?
What and all can a compiler provides by default?
Write a struct time where integer m, h, s are its members?
What is difference between initialization and assignment?
12 Answers HCL, HP, Infosys,
Explain the isa and hasa class relationships.
Can we use this pointer inside static member function?
What is a .lib file in c++?