Write a program in c++ to read two floating point numbers
and find their sum and average.
Answer Posted / 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 |
Post New Answer View All Answers
Why is encapsulation used?
What is destructor oops?
How to improve object oriented design skills?
#include
What is multilevel inheritance in oop?
What is abstraction and encapsulation?
Explain virtual inheritance?
Can static class have constructor?
What is the use of oops?
Can we override main method?
Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.
Why oops is important?
What is coupling in oop?
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout< What polymorphism means?