Sie sind auf Seite 1von 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; }

Das könnte Ihnen auch gefallen