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
Write a program to swap two numbers without using third variable in c?
What are near, far and huge pointers?
What is multidimensional arrays
FILE PROGRAMMING
What is 02d in c?
Function calling procedures? and their differences? Why should one go for Call by Reference?
What are enums in c?
Which is more efficient, a switch statement or an if else chain?
What is the purpose of the preprocessor directive error?
How can I read/write structures from/to data files?
What would happen to X in this expression: X += 15; (assuming the value of X is 5)
How can you increase the size of a dynamically allocated array?
How can I access an I o board directly?
how we can make 3d venturing graphics on outer interface
Why double pointer is used in c?