CS Electrical And Electronics
@cselectricalandelectronics

Find error in buzz and car c code? I am getting output 63, instead of car or buzz?

All QuestionsCategory: C LanguageFind error in buzz and car c code? I am getting output 63, instead of car or buzz?
CS Electrical And Electronics Staff asked 4 years ago

If the number is divisible by 10 print car if the number is divisible by 5 print buzz, else print number.

Code:

#include<stdio.h>
int main()
{
int n;
printf(“enter number\n”);
scanf(“d”,&n);
{
if(n%10==0)
printf(“car\n”,n);
else if(n%5==0)
printf(“buzz\n”,n);
else
printf(“d\n”,n);
}
//Chetan Shidling
return 0;
}

Can anyone solve this?