What are the output of the program given below?
Program 1
#include <iostream>
using namespace std;
int main(){
int width = 10;
int height = 15;
double wide;
cout<<"PROGRAMME TO CALCULATE WIDE FOR TRIANGLE\n";
cout<<"##############################\n";
wide=0.5*height*width;
cout<<"\nWIDE: "<<wide<<"\n";
cout<<"\n##############################################\n";
return 0;
}
Program 2
#include <iostream>
using namespace std;
int main()
{
int x = 180, y = 200;
y = ++x;
cout << " x : " << x << endl << " y : " << y << endl;
}
Program 1 will output:
PROGRAMME TO CALCULATE WIDE FOR TRIANGLE
##############################
WIDE: 75
##############################################
Program 2 will output:
x : 181
y : 181
Comments
Leave a comment