The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
 Compile and run the C code below. Pay attention to the formatting of the code. Add at least eight comments to the code to explain what the program does and how it works.
#include <stdio.h>
Â
int main(void) {
int firstNumber;
int secondNumber;
Â
printf("nThis program determines if the 1st non-zero integer entered is evenly ");
printf("divisible by the 2nd non-zero integer entered using the modulus operator.nn");
Â
printf("Enter 2 integers separated by a space: ");
scanf("%i %i", &firstNumber, &secondNumber);
Â
if(firstNumber == 0 || secondNumber == 0) {
printf("nError - Neither number can be 0. Sorry!nn");
}
else {
if(firstNumber % secondNumber == 0) {
printf("%i is evenly divisible by %i.nn", firstNumber, secondNumber);
}
else {
printf("%i is not evenly divisible by %i.nn", firstNumber, secondNumber);
}
}
return 0;
-----------