# Help !!!

This is a discussion on Help !!! within the C Programming forums, part of the General Programming Boards category; please could anyone help me with this assigment!!! which contains pointers and functions BTW----> iam a biginner here is the ...

1. ## Help !!!

please could anyone help me with this assigment!!!

which contains pointers and functions

BTW----> iam a biginner

here is the problem:

Write a complete C program to compute the least common divisor (LCD). The program should reverse and sum the digits of the given integers. Use the following functions with pointers:

Function Fun_1 to compute the least common divisor
Function Fun_2 to reverse and sum the digits of the given integer

Sample Run:

|1 – To Reverse and Sum the Digits
|2 - To compute LCD
|3- Exit
………………………………….
1
Input the given numbers
Num1: 123
Num2: 456

Reverse of Num1: 321
Sum of Num1 digits: 6

Reverse of Num2: 654
Sum of Num2 digits: 15
--------------------------------------------------------------------------------
i was able to find some codes, maybe it's usefull

this one for the sum
Code:
```#include <stdio.h>
int main()
{
int x,y,
sum = 0;
printf("Enter the number \n");
scanf("%d",&x);
for (x!=0;y=x%10;x/=10)
sum =sum+ y;
{
printf("The sum is %d\n", sum);
}
return 0;
}```
and this one for the inverse
Code:
```#include<stdio.h>
main()
{
int num,
rev=0;
printf("\n Enter the number\n ");
scanf("%d", &num);
while(num>0)
{
rev = (rev * 10) + (num % 10);
num = num / 10;
}
printf("\n Reverse of the number is %d", rev);
return(0);
}```
thanks...

2. Stop finding za codez on za internet, and start writing them yourself. Anything else is just a total waste of time and if it is wasting your time it certainly is wasting ours. So come back when you have your own attempt at the problem, and we will help you move on from there.

3. well,,...
i don't need the whole code,
what i need is the beginning, so i can continue
like the prototypes for instants

4. Originally Posted by goby
well,,...
i don't need the whole code,
what i need is the beginning, so i can continue
like the prototypes for instants
This should get you started:

Code:
```#include <stdio.h>

int main(void){
/* CODE GOES IN HERE*/
return 0;
}```

5. any more help!??..

6. Originally Posted by goby
any more help!??..
I think you're missing the point.... This isn't a "we do your homework for you" service. You need to show an effort. The volunteers here will help you out if you get stuck, but they're not going to write your code for you.

Believe me you won't learn a darned thing if you try to scrape through on "borrowed" code. To learn programming you need to write programs of your own creation.

So... sit down, puzzle it out as far as you can, write some original code...

Popular pages Recent additions