1
The function funA()
stores a value entered by the user.
The function funB()
will allow the user to choose an option.
My difficulty is in the third function: I need to create a function that multiplies the value stored in the first function by the value generated by the user’s choice. I don’t know how to call these functions within the C function and use the stored values.
#include <stdio.h>
#include <stdlib.h>
void funA(){
int numA;
scanf("%d", &numA);
}
void funB(){
int numB;
float x;
printf("Escolha um valor:\n");
printf("1 - Alto\n");
printf("2 - Medio\n");
printf("3 - Baixo\n");
scanf("%d", &numB);
if(numB == 1){x = 100;}
if(numB == 2){x = 50;}
if(numB == 3){x = 10;}
}
void funC(){
//?????
}
Got it! Thank you so much!
– Van Ribeiro