#include <stdio.h>
int main(){
int a = 1;
for(a; a <= 100; a++){
if(a % 10 == 3 || a % 10 == 6 || a % 10 == 9){
printf ("pair\n");
}
else if(a / 10 == 3 || a / 10 == 6 || a / 10 == 9){
printf ("pair\n");
}
else{
printf("%d\n", a);
}
}
return 0;
}
Else is missing in front of if
I've improved the code a little bit.
#include <stdio.h>
int main(){
int a = 1;
for(a; a <= 100; a++){
if(a == 33 || a == 66 || a == 99){
printf ("clap\n");
}
else if(a % 10 == 3 || a % 10 == 6 || a % 10 == 9){
printf ("pair\n");
}
else if(a / 10 == 3 || a / 10 == 6 || a / 10 == 9){
printf ("pair\n");
}
else if(a % 3 == 0){
printf ("pair\n");
}
else{
printf("%d\n", a);
}
}
return 0;
}
891 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
610 Uncaught (inpromise) Error on Electron: An object could not be cloned
568 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.