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 |
Can main method override?
What is a mixin class?
What type of Job you are providing?
What is polymorphism what is it for and how is it used?
What is encapsulation selenium?
Write a program to accept a number and to print numbers in pyramid format? for eg:for a no. 5 1 212 32123 4321234 543212345
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
What is the renewal class?
what is ns string? what is ns array?
what is virtual function in c++
What is use of overloading?
What is the difference between abstraction and polymorphism?