Answer Posted / harry0009
#include<iostream.h>
class sample
{
int a,b;
public:
void setvalue()
{
a = 25;
b = 45;
}
friend float mean(sample s);
};
float mean(sample s)
{
return(float(s.a+& b)/20);
}
void main()
{
sample ;
x.setvalue
cout<<"mean value"<<mean(x);
getch();
}
| Is This Answer Correct ? | 11 Yes | 4 No |
Post New Answer View All Answers
Explain what is meant by 'bit masking'?
What does the file stdio.h contain?
Write a progarm to find the length of string using switch case?
What is wrong with this statement? Myname = 'robin';
Explain what are global variables and explain how do you declare them?
When should structures be passed by values or by references?
any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above
what are bit fields? What is the use of bit fields in a structure declaration?
the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset
Explain what is #line used for?
What are integer variable, floating-point variable and character variable?
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
What is the size of a union variable?
What is formal argument?
How can I get the current date or time of day in a c program?