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 a file operation in C with an example.
What would be an example of a structure analogous to structure c?
Can we assign integer value to char in c?
What is pointer to pointer in c?
Write a program to check whether a number is prime or not using c?
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
What is realloc in c?
What is the advantage of using #define to declare a constant?
Can we access the array using a pointer in c language?
What is the g value paradox?
How do you define a function?
Calculate 1*2*3*____*n using recursive function??
What is use of null pointer in c?
Can we change the value of static variable in c?
Explain enumerated types.