Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Problem with some easy programms :) C++

$
0
0
Hello all,my first post here :)/>
I came across this forum and i think its a good place to post some problems i am dealing with as a newbie :)/>.
Ok,so these are the programms i want to do:

1. Program that finds the smallest difference penultimate and last digit of 4 numbers you entered from the keyboard;

What is the easiest way to do it :)/>? I know how to find last or penultimate digit of a number, but how to include the smallest difference into the program :P/>, its confusing me lol There must be an easy way to do it :s

2. Write a program that finds the greatest common divisor two whole numbers a and b;

This sounds easy, i start it as
int a,b,n; (n is divisor i need to find)
printf("write first number");
scanf("%d",&a);
then same for the second one;
printf("enter n");
scanf("%d",&n);
if (a%n==0 & b%n==0) ... (and then idk:P ,this way we will find if a and b divides with n without leftover,but thats not what i need ://>)

Thanks in advance :)/>,any help appreciated :D/>

"noob"

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>