Question
QUESTION 1 1. Write a for loop that runs 5 times and accepts the input of an integer number every time. Those numbers will be
QUESTION 1
1. Write a for loop that runs 5 times and accepts the input of an integer number every time. Those numbers will be accumulated by a variable called total.
QUESTION 2
1. Convert the following decimal number : 39 to binary
QUESTION 3
1. Convert the following hexadecimal number : C94 to binary
QUESTION 4
1. Convert the following hexadecimal number : E72 to binary
QUESTION 5
1. Convert the following decimal number : 47 to binary
QUESTION 6
1. Convert the following binary number : 1110001 to decimal
QUESTION 7
1. Print the following message on the screen with one line of code: "Hello , this is a C program"
QUESTION 8
1. Write a statement that adds variable x to variable sum and assign the result to sum.
QUESTION 9
1. Convert the following decimal number : 84 to binary
QUESTION 10
1. Write a single C statement to accomplish the following: Assign the sum of x and y to z and increment the value of x by 1 before the calculation. __________________________
QUESTION 11
1. The _____ standard library function displays information on the screen.
QUESTION 12
1. sum = num1 + num2; and num1 + num2 = sum; are both valid C statements.
True
False
QUESTION 13
1. All variables must be given a type when they are declared.
True
False
QUESTION 14
1. #include
True
False
QUESTION 15
1. int m, n, x, y ; m= 10; n = 20; x = 15; y = m + n / x; After the last stattement is executed the value of y will be 11
True
False
QUESTION 16
1. Every C statement ends with ;
True
False
QUESTION 17
1. #define TRUE 1 #define FALSE 0 These pre-procesoor directives will define the words TRUE and FALSE to be used as boolean variables
True
False
QUESTION 18
1. scanf("%d", num1); Assuming that num1 is an integer variable, will the above statement run properly?
True
False
QUESTION 19
1. Comments cause the computer to print the text enclosed between /* */ on the screen when the program is executed.
True
False
QUESTION 20
1. C will consider the variables number and NUmber identical.
True
False
QUESTION 21
1. int m, n, x, y ; m= 6; n = 4; x = 5; y = m + n / x; After the last statement is executed the value of y will be 2
True
False
QUESTION 22
1. What will be printed out when the following code executes? int num = 91; switch (num) { case 90: printf("90 "); case 91: printf("91 "); break; case 92: printf("92 "); break; default: printf("default "); }
91 | ||
91 default | ||
91 92 | ||
90 91 |
QUESTION 23
1. Given: int a= 36, b= 7, result; result = a / b ; The value of result will be:
5.142857 | ||
5 | ||
6 | ||
1 |
QUESTION 24
1. Which of the following are valid C expressions.
number1 = number2 *(number3 + number4); | ||
number + sum = z ; | ||
sum = sum + number; | ||
7 = number ; |
QUESTION 25
1. Which of the following is a complete, legal C program?
B. #include | ||
D. #include | ||
C. #define PI main() { printf(Hello, world ); } | ||
A. #include |
QUESTION 26
1. What is the value of the variable intResult, given: int a = 3, b = 2, c = 10, intResult; intResult = c - a / b;
3 | ||
3.5 | ||
8.5 | ||
9 |
QUESTION 27
1. Which variable names are valid
piece Flag | ||
sum$Value | ||
int | ||
sum | ||
1counter | ||
taxRate | ||
pieceFlag |
QUESTION 28
1. long int ivar1, ivar2 = 20, ivar3 = 6; double dvar1, dvar2 = 1.2, dvar3 = 4.5; ivar1 = dvar2; printf("ivar1= %i ", ivar1); This program will display (content of ivar1):
1.2 | ||
1.0 | ||
1 | ||
none of the above |
QUESTION 29
1. What will be the output (content of ivar1) with the following code: long int ivar1, ivar2 = 20, ivar3 = 6; double dvar1, dvar2 = 1.2, dvar3 = 4.5; ivar1 = ivar2 % ivar3 * 2; printf("ivar1= %i ", ivar1);
6 | ||
4 | ||
3 | ||
none of the above |
QUESTION 30
1. What will be the ouput with the following code: long int ivar1, ivar2 = 20, ivar3 = 6; double dvar1, dvar2 = 1.2, dvar3 = 4.5; dvar1 = (double) ivar2 / ivar3; printf("dvar1= %lf ", dvar1);
3 | ||
3.333333 | ||
3.000000 | ||
none of the above |
QUESTION 31
1. Given: int x,y,result; x = 9; y = 10; result = x + y * 3 - 12; The value of result will be :
27 | ||
45 | ||
-171 | ||
none of the above |
QUESTION 32
1. In a switch staement the default case is required
True
False
QUESTION 33
1. In case that you have to compare a range of values in a multiple selection statement you cannot use the switch statement. You will have to use if-else
True
False
QUESTION 34
1. An else statement may have an associated if, but is optional.
True
False
QUESTION 35
1. In a switch staement the default case is required
True
False
QUESTION 36
1. An if statement may have an associated else
True
False
Bottom of Form
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started