Weird outputs | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Weird outputs

#include <bits/stdc++.h> using namespace std; main() { int A,B; int T; cin >> T; int total ,even,odd; while(T--) { even=0,odd=0; int i =1; for(i;i<=A;i++) { if(i%2==0) { even1++; } else { odd1++; } } for(int j=1;j<=B;j++) { if(j%2==0) { even2++; } else { odd2++; } } total = even1 ; cout << even1<<endl; } }

13th Dec 2020, 5:24 AM
Ravi anshuman
Ravi anshuman - avatar
0 Answers