0

Help me correct this code

#include <iostream> using namespace std; int main() { cout << "char: " << sizeof(char) << endl; cout << "int: " << sizeof(int) << endl; cout << "float: " << sizeof(float) << endl; cout << "double: " << sizeof(double) << endl; int var = 50; cout << "var: " << sizeof(var) << endl; int a,b,c; int a=10; int b= 20; int c= 30; cout<< "value of sum"<< a+b+c<< endl; cout << a+b+c<< sizeof(b)<<endl; return 0; }

3rd May 2019, 4:40 PM
Tiwary Sourav
Tiwary Sourav - avatar
2 Answers
+ 1
You don't need to put 'int' for 'a' after you declare it, you should just asign it with a = 10 without 'int'
3rd May 2019, 4:43 PM
raget88
raget88 - avatar
+ 1
Thnx
3rd May 2019, 4:46 PM
Tiwary Sourav
Tiwary Sourav - avatar