When i run the program all are greatest | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

When i run the program all are greatest

#include <stdio.h> int main() { int a,b; printf("enter the values of int a,b"); scanf("%d%d",&a,&b); if(a>=b); printf("the greatest is %d",a); if(b>=a); printf("the greatest is %d",b); }

3rd Nov 2020, 7:14 PM
Maureen kirotich
Maureen kirotich - avatar
4 Answers
+ 8
maureen kirotich your code is incomplete please attach the complete code and what you want to achieve with the code so we can help you out.
3rd Nov 2020, 7:24 PM
GAWEN STEASY
GAWEN STEASY - avatar
+ 3
Remove the semicolons after the if() statements and swap the second one with an if else() or even better an "else" (with no condition)
4th Nov 2020, 12:14 AM
Davide
Davide - avatar
+ 1
seems it’s not complete yet, and remove ; by the end
3rd Nov 2020, 9:11 PM
Meqdad
Meqdad - avatar
0
Have you completed it ?
3rd Nov 2020, 8:02 PM
Hamza Mohammad Khan
Hamza Mohammad Khan - avatar