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 a program flowchart and explain how does it help in writing a program?
Can I initialize unions?
Where is c used?
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
Explain how do you declare an array that will hold more than 64kb of data?
What is page thrashing?
What are the 4 types of unions?
Is there a way to jump out of a function or functions?
What does void main return?
Can a pointer be volatile in c?
Is c# a good language?
Give differences between - new and malloc() , delete and free() ?
Write a program to print “hello world” without using semicolon?
What is use of pointer?
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result