#include <iostream>
using namespace std;
int main() {
cout << "hello world" << endl; //prints output "hello world", then moves down a line
int i=2; //assigns value 2 to integer variable i
cout << "i = " <<i<<endl; //outputs string "i = " followed by 2
double a=3.3; //assigns double value 3.3 to variable a
cout << "a = " <<a<<endl; //outputs string "a = " followed by 3.3
int j = a*i; //assigns the product of 3.3 and 2 to integer value j. Also, it rounds down so the value of the integer j is 6.
cout << "a*i = "<<j<<endl; // outputs string "a*i = " followed by a 6
return 0; //exits the program
}
OUTPUT:
[cms-opendata@localhost src]$ ./a.out
hello world
i = 2
a = 3.3
a*i = 6