Answer and Explanation:
In C programming language:
char fun(int*a, int*b){
printf("enter two integers: ");
scanf("%d%d",a,b);
int e;
printf("please enter a character: ");
e=getchar();
return e;
}
int main(int argc, char *argv[]) {
int d;
int f;
int g;
fun();
printf("%d%d%d", d, f, g);
}
We have declared a function fun type char above and called it in main. Note how he use the getchar function in c which reads the next available character(after the user inputs with printf()) and returns it as an integer. We then return the variable e holding the integer value as char fun() return value.
Answer:
- Print the values days of bottles.
- Display total number of bottles collecting.
- Display the payout for this transaction.
Explanation:
Program:-
DEPOSIT_PER_BOTTLE = 0.10
another = "Y"
while another=="Y":
print("Input Values 7 days of bottles:")
total = 0
for I in range(7):
collected_bottles = int(input())
total += collected_bottles
payout = total*DEPOSIT_PER_BOTTLE
print("Total number of bottles collected: {:,}".format(total))
print("Payout for this transaction $%.2f"%payout)
another = input("Do you want to complete another transaction? ").upper()
Open source is created and updated by a worldwide community of programmers and is available for free. Many students are in luck, as they can easily study publicly accessible codes and have a possibility to make better software. It also has lots of advantages, such as getting <span>high-quality results when the source code is passed around, tested and fixed.The most important thing - it<span> is a valuable learning opportunity for programmers and opportunity to improve their skills.</span></span>
Answer:
Variable, operator, expression, value.
Explanation:
We could use variables, operators, expressions, and values in a mathematical formula, we're going to do an example with every part.
For this example we're going to use a simple sum formula:
First, we have 3 variables:
sum;
sum1;
sum2;
Second, we have 3 operators:
=, + and *
Third, we have our expression and 1 value:
sum = sum1 + (sum2 * 5);
(sum2 * 5) = expression;
5 = value;
We're going to see the result when we print the variable sum.