Welcome Guest | Sign in | Register

Home > C Programming > Assignments > Questions and Answers

Exercise:

Section 1

01. The statement which correctly assigns the value of the variable number1 to the variable total, is
A. total := number1; B. number1 = total;
C. total = number1; D. number1 := total;

Answer and Explanation

Answer: total = number1;

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
02. The statement that correctly assigns the sum of the two variables loop_count and petrol_cost to the variable sum, is
A. sum = loop_count + petrol_cost; B. loop_count = sum + petrol_cost;
C. petrol_cost = sum - loop_count; D. sum = petrol_cost / loop_count;

Answer and Explanation

Answer: sum = loop_count + petrol_cost;

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
03. The correct statement which divides the variable total by the value 10 and leaves the result in the variable discount, is
A. discount = total / 10; B. discount = 10 / total;
C. total = discount / 10; D. total = 10 / discount;

Answer and Explanation

Answer: discount = total / 10;

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
04. The correct statement which assigns the character W to the char variable letter, is
A. letter = "W"; B. letter = 'W';
C. char letter = "W"; D. strcpy( letter, "W" );

Answer and Explanation

Answer: letter = 'W';

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
05. The correct statement which assign the decimal result of dividing the integer variable sum by 3 into the float variable costing, is (Use type casting to ensure that floating point division is performed)
A. Given: int sum = 7; float costing; B. (float) costing = sum / 3;
C. costing = (float) (sum / 3); D. costing = (float) sum / 3;

Answer and Explanation

Answer: costing = (float) sum / 3;

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum



Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.