cant finish code

iv been at this code for the last couple of days trying to make out how to do it but I'm still nun the wiser. its for a school class project. i have found some of the steps I need online but they are wrote different to how I am thought in school and I cant understand them to be able join them into my program. what I'm trying to get my program to do it first let me enter a number, then multiply this number by 9, add up all the numbers in this answer apart from the last, divide this by 9, then multiply the decimals in this answer by 9(but turn the hole number to 0),
is there any codes out there similar to this that I can change to suit my needs or any hope someone can give me a few steps, the bit of code is the only bit that I have got fully working correctly in the format I need so far. I'm really stuck at this stage and any help would be great
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  #include <stdio.h>
#include <iostream>
using namespace std;
void calc(int);

int main()
{
int numb;
printf("enter 3 diget number above 0:\n");
scanf("%i", &numb);
calc (numb);

    return 0;
}
void calc (int n)
{
	n=n*9;
	printf("the enterd number multiplyed by 9 id %i\n",n);
	return;

}

void calc (long)
{
return;
}
Write to an array and then You need to use pop_back in order to get rid of the last number dont forget to add #include <algorithm> search for pop_back on this site for the tutorial.

hope this helps, cheers
Topic archived. No new replies allowed.