I'm making a program that takes a three-digit integer and splits it into two integers. 224 would become 220 and 4. 114 would become 110 and 4.
Basically, you do it with modulos. I wrote what I think should work and the compiler keeps saying that there is a missing parenthesis before the &big but any changes just make more errors happen.
#include <stdio.h>
void split_num(int complete, int *big, int *little){
*little = complete%10;
*big = complete - *little;
return;
}
int main()
{
int complete, big, little;
printf("Give an integer to split: \n");
scanf("%d", &complete);
void split_num(complete, &big, &little);
printf("Num split into 2 is : %d and %d", big, little);
return 0;
}
voidbeforesplit_numwhen you call it inmain. see what happens if you remove that