CPP-2 online test, online practice test, exam, quiz

Ask a question
          

CPP-2 online test, online practice test, exam, quiz

www.careerride.com


1. What is the output of the following code snippet assuming user enters the side as 4?

class square
{
public:
double side1;
double area()
{
return(side1*side1);
}
};

int main(){
double area1=0;
square c1,c2;
cout << "Enter the length of the square" << endl;
cin >> c1.side;
cout << "The area of the square is : " << c1.area1() << endl;
return(0);
}






       View Answer and Discussion

Total 24 questions Time spent 0:0

Home | Login | About us | Sitemap | Contact us