#c++ mid exam question
int x,y,z;
x=5;
y=5;
z=2;
z+= x%y + x++ + --y - 2;
cout<<"sum="<<z;
write the output ??
int x,y,z;
x=5;
y=5;
z=2;
z+= x%y + x++ + --y - 2;
cout<<"sum="<<z;
write the output ??
FRESHMAN TIPS pinned «#c++ mid exam question int x,y,z; x=5; y=5; z=2; z+= x%y + x++ + --y - 2; cout<<"sum="<<z; write the output ??»
What will be the output of the following code snippet?
void solve() { int a[ ] = {1, 2, 3, 4, 5}; int sum = 0; for(int i = 0; i < 5; i++) { if(i % 2 == 0) { sum += a[i]; } } cout << sum << endl; }
void solve() { int a[ ] = {1, 2, 3, 4, 5}; int sum = 0; for(int i = 0; i < 5; i++) { if(i % 2 == 0) { sum += a[i]; } } cout << sum << endl; }
Anonymous Quiz
17%
5
33%
15
25%
9
25%
6
What will be the output of the following code snippet?
#include <stdio.h> int main() { int a = 3, b = 5; int t = a; a = b; b = t; printf("%d %d", a, b); return 0; }
#include <stdio.h> int main() { int a = 3, b = 5; int t = a; a = b; b = t; printf("%d %d", a, b); return 0; }
Anonymous Quiz
31%
3 5
38%
5 3
19%
33
13%
5 5
👍1