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;
}
+ 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;
}
+ 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
0
Michaelangelo Garrison
Where is your attempts?
0
Michaelangelo Garrison
Atleast you should show something otherwise noone will help you.
0
#include <iostream>
using namespace std;
int main() {
int a;
cin >> a;
cout << 50 - a % 50;
return 0;
}
// Hope this helps