0
🅰🅹 🅐🅝🅐🅝🅣 and Michaelangelo Garrison This is my answer, please mention the errors if any occured in this program. #include <iostream> using namespace std; int main() { int p; cin>>p; while(p>=50) { p=p-50; } if(p==0) cout<<p; else cout<<(50-p); return 0; }
10th May 2021, 4:26 AM
Akash Singh
Akash Singh - avatar
+ 1
Akash Singh No need to use loop here. You can just do in one line 50 - p % 50 #include <iostream> using namespace std; int main() { int p; cin>>p; cout << (50 - p % 50); return 0; }
10th May 2021, 5:01 AM
A͢J
A͢J - avatar
+ 1
#include <iostream> using namespace std; int main() { //your code goes here int num,num2; cin>>num; if(num<=50){ cout<<50-num; }else if(num>50){ num2=num%50; cout<<50-num2; } return 0; } //each if statments explain the concepts
10th May 2021, 6:05 AM
Alto
Alto - avatar
0
Michaelangelo Garrison Where is your attempts?
10th May 2021, 3:43 AM
A͢J
A͢J - avatar
0
Michaelangelo Garrison Atleast you should show something otherwise noone will help you.
10th May 2021, 3:56 AM
A͢J
A͢J - avatar
0
#include <iostream> using namespace std; int main() { int a; cin >> a; cout << 50 - a % 50; return 0; } // Hope this helps
12th May 2021, 2:09 AM
Calvin Thomas
Calvin Thomas - avatar