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 |
What is the difference between static link library and dynamic link library?
Explain function overloading and operator overloading.
class professor {}; class teacher : public virtual professor {}; class researcher : public virtual professor {}; class myprofessor : public teacher, public researcher {}; Referring to the sample code above, if an object of class "myprofessor" were created, how many instances of professor will it contain? a) 0 b) 1 c) 2 d) 3 e) 4
Assume studentNames and studentIDs are two parallel arrays of size N that hold student data. Write a pseudocode algorithm that sorts studentIDs array in ascending ID number order such that the two arrays remain parallel.
Explain the auto storage classes in c++.
Describe exception handling concept with an example?
Why cstdlib is used in c++?
Difference between delete and free.
C is to C++ as 1 is to a) What the heck b) 2 c) 10
Ask to write virtual base class code?
Should the member functions which are made public in the base class be hidden?
What is a pure virtual function? Why is it represented as = 0...how is the internal implementation for the same