Question: Part 1: Commenting Code Enter the code provided in the assignment Resources in CodeBlocks, compile, and run. Pay attention to the formatting of the code.

Part 1: Commenting Code Enter the code provided in the assignment Resources in CodeBlocks, compile, and run. Pay attention to the formatting of the code. Add at least eight comments to explain what the program does and how it works. Be sure to include a comment at the top the file as a header like the one used in Unit 1. After adding your comments, build and test the program to make sure it still builds and runs correctly.

/* Ann Smith - IT2240 - U02a1 - Part 1 * 10/01/2015 Rev. 1 */

//You should add at least 5 comments to the code provided. Be sure to recompile and test the code after you have added your comments to make sure you have not introduced any syntax errors.

#include

int main(void) { int firstNumber; int secondNumber;

printf(" This program determines if the 1st non-zero integer entered is evenly "); printf("divisible by the 2nd non-zero integer entered using the modulus operator. ");

printf("Enter 2 integers separated by a space: "); scanf("%i %i", &firstNumber, &secondNumber);

if(firstNumber == 0 || secondNumber == 0) { printf(" Error - Neither number can be 0. Sorry! "); } else { if(firstNumber % secondNumber == 0) { printf("%i is evenly divisible by %i. ", firstNumber, secondNumber); } else { printf("%i is not evenly divisible by %i. ", firstNumber, secondNumber); } } return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!