Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this prog mult's the rightmost and leftmost
- #include <stdio.h>
- // 12409 will be used for testing
- int num = 12409, l, r, ans ;
- int main() {
- // for the rightmost we will div by 10,000 ( for finding the rightmost we always divide
- r = 12409 / 10000;
- printf("right most = %d\n", r);
- // since we have 1 ten thousand in 12409 the rightmost will be 1
- l = 12409 % 100;
- printf("leftmost = %d\n", l);
- // now we gotta mult them
- ans = l * r;
- printf("--------------------------\n");
- printf("LSB mult by MSB = %d", ans);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement