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 polymorphism is used in oops?
What is abstraction example?
What are the features of oop?
Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
Why is it so that we can have virtual constructors but we cannot have virtual destructors?
c++ program to swap the objects of two different classes
what are the ways in which a constructors can be called?
What does oop mean in snapchat?
What are the 3 principles of oop?
Can a destructor be called directly?
What is overloading in oop?
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?
What is encapsulation with example?
what is graphics