Write a program in c++ to read two floating point numbers
and find their sum and average.
Answers were Sorted based on User's Feedback
Answer / kiranlivz
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float a,b,sum,avg;
cout<<"Enter 2 digits"<<endl;
cin>>a>>b;
cout<<"the 2 digits are:"<< " ";
cout<<a<<" "<<b<<;
sum=a+b;
avg=(a+b)/2;
cout<<"sum of the no."<<" ";
cout<<sum<<endl;
cout<<"avg of the no."<<" ";
cout<<avg;
getch();
}
| Is This Answer Correct ? | 15 Yes | 10 No |
Answer / mahmali
#include<iostream.h>
#include<conio.h>
main()
{
float a,b,sum,avg;
cout<<"Enter values of a and b";
cin>>a>>b;
sum=a+b;
avg=sum/2;
cout<<"sum of the no.="<<sum;
cout<<"avg of the no.="<<avg;
getch();
}
| Is This Answer Correct ? | 2 Yes | 5 No |
What is and I oop mean?
write a c++ code of diagonal matrix.
function overridind means and simple program
Write a program to find out the number of palindromes in a sentence.
Base class has two public data members. How can i derive a new class with one datamember as public and another data member as private?.
Explain the concept of abstracion and encapsulation with one example. What is the difference between them?
Definition of Object Oriented Programming in single line?
33 Answers Impact Systems, Q3 Technologies, TCS,
difference between structure and union.
Describe these concepts: Polymorphism, Inheritance and Abstraction.
should we use linear search or binary search if elements are placed in random order or mixed?in both cases? i need a little bit detail ans?thnks
I hv a same function name,arguments in both base class and dervied class, but the return type is different. Can we call this as a function overloading? Explain?
What is Virtual Keyword?