1.Write the C statement required to declare the variable balance which is going to be used to store a money value.
2.Write only one C statement that declares the variable LastName and sets its initial value to J.
3.Provide the values of a and b at the various points (right after each instruction is executed) in this program segment.
a = 1;
b = 1;
4.Declare the constant e = 2.72 to be used within a C program.
5.Mark as correct (C) or incorrect (I) in the blank the following comment statements.
//declare variables
/initialize variables
/* multiply variables together */
*/ This program finds the average of three numbers. */
6.In order to get the following output in the screen:
I am 25 years old
My last name initial is M
complete the printf statements using the declared variables in the following program segment:
int age=25;
char init=’M’;
7.Write only one printf statement to get the same output as question # 6.
8. Complete the program segment below.
char grade;
printf(“Enter your final grade letter for ELTR-310\n”);
scanf(
printf(“Your final grade in ELTR-310 is );
9.Complete the program segment below:
int age;
printf(“Please enter your age: \n”);
scanf(“%d”, &age);
If ( )
printf(“You are not allowed to consume alcoholic drinks”);
else
printf(“Yes, you can have a beer”);
10.Complete the following program segment such that it prints out odd numbers from 1 to 199 and then prints “Done”.
int a;
for
printf(“%d “, a);
printf(“Done”);
Excellent Solution
================
*Instant Download
Write the C statement required to declare the variable balance
- Technology: C-Programming
- Code: SHC_C_10004
-
$9.99
Tags: c, variable, balance, store, money, value, LastName, constant