Main Gestures Programming Music Whoizzy? Links

C Programming

NUMBER CRUNCH V2
EXERCISE 1

#include <stdio.h>

int main(void)
{
   int x, y, z;

   printf("Enter 1st number: ");
   scanf("%d", &x);

   printf("Enter 2nd number: ");
   scanf("%d", &y);

   z = x + y;
   printf("\n%d + %d = %d", x, y, z);

   z = x - y;
   printf("\n%d - %d = %d", x, y, z);

   z = x * y;
   printf("\n%d * %d = %d", x, y, z);

   z = x / y;
   printf("\n%d / %d = %d", x, y, z);

   printf("\n\nOne more time! \n\n");

   printf("Enter 1st number: ");
   scanf("%d", &x);

   printf("Enter 2nd number: ");
   scanf("%d", &y);

   z = x + y;
   printf("\n%d + %d = %d", x, y, z);

   z = x - y;
   printf("\n%d - %d = %d", x, y, z);

   z = x * y;
   printf("\n%d * %d = %d", x, y, z);

   z = x / y;
   printf("\n%d / %d = %d", x, y, z);

   return 0;
}

GO BACK

Found a broken link?
Mail Me