C++ Language
1. List any four different data types that have been discussed in class and/or used in your programs.
2. The expression 4 + 6 / 3 * 0 evaluates to
3. Code two different ways to add 1 to a variable called count and have the result stored in count.
1.The four data types used in c++ are:
2. The output of the code is 4 because it uses the simple BODMAS rule to calculate the expression.
So the answer is 4.
3.The two different ways are as follows:
#include <bits/stdc++.h>
using namespace std;
int main(){
// First way
int count = 0;
count = count + 1;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int main(){
// Second way
int count = 0;
count = count++;
return 0;
}
I have included the necessary comments that will help you understand the solution.
I hope you have understood the solution. If you like the solution kindly upvote it.
Get Answers For Free
Most questions answered within 1 hours.