0% found this document useful (0 votes)
55 views

60-106 ASSIGNMENT #1 Solution

The document contains solutions to two programming problems. The first problem calculates the quotient and remainder of two integers input by the user. The second problem prints out an address in the format shown as an example in the textbook.

Uploaded by

dead_knight
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

60-106 ASSIGNMENT #1 Solution

The document contains solutions to two programming problems. The first problem calculates the quotient and remainder of two integers input by the user. The second problem prints out an address in the format shown as an example in the textbook.

Uploaded by

dead_knight
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

60-106 ASSIGNMENT #1 Solution

Solution Problem 1: /* Assn1 - Solution Problem 1*/


#include <stdio.h> int main(void){ int number1, number2; int answer1, answer2; //input variables //output variables

printf("Enter an integer : "); scanf("%d", &number1); printf("Enter another integer : "); scanf("%d", &number2); answer1 = number1 / number2; answer2 = number1 % number2; //calculate the quotient // calculate the remainder

printf("\n**********\n\n"); //print output as shown in the sample printf("%d / %d = %d\n", number1, number2, answer1); printf("%d %% %d = %d\n\n", number1, number2, answer2); printf("**********\n"); return 0; } //end of main

Solution Problem 2:
/* Assn2 - Solution Problem 2: Programming Exercise 2-2 of the textbook */ #include <stdio.h> int main(void) { printf("Adam West\n"); printf("485 C Primer Plus Street\n"); printf("Windsor, ON N9B 3P4\n"); return 0; }

You might also like