Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //this program is used to mult the first and 4th digit of 4 digit int
- // 7023 is used for testing
- #include <stdio.h>
- int num, num1, num2, num3, num4;
- int main(void) {
- printf("Enter a int that consists of 4 digits\n");
- scanf_s("%d", &num);
- num1 = num % 10; // Lsb
- printf("%d", num1);
- num3 = num / 1000; //msb
- printf("%d", num);
- num4 = num1 * num3;
- printf("the sum of * of the Lsb and Msb = \n");
- printf("%d", num4);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement