0
Is there any bug in the code below? I am solving the problem number 1044 from URI online judge.
#include <stdio.h> int main() {int A,B; scanf("%d %d",&A,&B); if(A%B==0 || B%A==0); {printf("%Sao Multiplos\n");} else {printf("Nao sao Multiplos\n");} return 0; }
10 Answers
+ 3
There is semi colon after the if condition and printf ("%???what?") there is a format specifier missing with what value you want to print.
Add some spaces and line breaks for better readability.
+ 2
you can use %d format specifier
+ 1
Thanks Akib Reza ...The program ran successfully
0
Which format specifier should I use?
0
#include <stdio.h>
int main() {int A,B;
scanf("%d %d",&A,&B);
if(A%B==0 || B%A==0)
{printf("%Sao Multiplos\n");}
else {printf("Nao sao Multiplos\n");}
return 0;
}
0
After running the program I have noticed that a 1 or 0 is printed in the output.. But I don't want to print them. What can I do now?
0
// Why you have inserted % below???
printf("%Sao Multiplos\n");
Anyway i also making challenges there and i use codechef for online compiling
0
KrOW It was a typing mistake.. By the way thanks
0
Can you save your code on Code Playground section and post here his link? In this way we can run it
0
Mehrin Jahan I have seen your code and ITS not the same that you have pasted... In your printf remove the format strinf param "%d" and you will see that no int will output... Please next time post your code link directly