I need answers for this : //Thanks a lot ^_^ -----------------------------------
ID: 3773676 • Letter: I
Question
I need answers for this :
//Thanks a lot ^_^
-----------------------------------------------
6.
C is strongly typed, i.e., variables/constants have a certain data type.
(True , False)
7.
In C programming language, it is necessary to declare variables before use. (True , False)
8.
Modulus operator (%) can be applied to variable of type float (True , False)
9.
The while loop usually runs its statements at least zero or more times. (True , False)
10.
The for loop does allows initialization of the counter variable. (True , False)
11. In a do –while loop the test occurs at the end of loop body. (True , False)
12. In functions in C, parameters are classified as formal and actual. (True , False)
13. In a while loop, if the condition is false at the beginning, the loop will not
execute at all. (True , False)
14. In this expression, Q= ((float) 9 / 5)*(f - 32). Q is of type int. (True , False)
15. Float P = 101.54321, printf("%.3f", P) will print 101.543. (True , False)
16 . When we use functions in our programs, testing and correction of errors becomes
easy. (True/False)
17. Functions promote code reusability. (True/False)
18. A function is said to be void if it has no return type (True/False)
19. Sin (x) is an example of single argument function. ( True/ False)
20 . A single array must contain elements of the same type (True/False)
--------------------------------------------------------------------------------------------------
(b)Write a complete C function MIN to find the minimum of two integers. Demonstrate the use of your function by calling it from a main function.//(C language)
--------------------------------------------------------------------------------------------
3. Consider the code given below.
/* Reads data into two arrays and subtracts their corresponding elements, storing the result in another array. */
#include<stdio.h>
#define SIZE 11
int main(void) {
int first[SIZE], second[SIZE], add[SIZE], i;
printf("Enter %d data items for first array : ", SIZE);
for(i=0;i<SIZE; i++) // input first array
scanf("%d",&first[i]);
printf("Enter %d data items for second array : ", SIZE);
for(i=0;i<SIZE; i++) // input second array
scanf("%d",&second[i]);
for(i=0;i<SIZE; i++) // compute the sum
diff[i]= second[i] + first[i];
printf(" Output of the arrays : ");
for(i=0;i<SIZE; i++) // output the arrays
printf("%5d %5d %5d ", first[i], second[i], add[i]);
system("pause");
return 0;
}
Answer the following questions
a.What are the array names in the program?(i)…………………(ii) ………………
(iii)............................
b.What type of variable are the elements in each array?……………………………..
c.How many elements in each array? ………………………………………………
d.What is the value of the maximum index in each array…………………………….
e.How many loops in the program …………………………………………………
f. Explain the function of each for-loop in the code
.................................................................................................
.................................................................................................
.................................................................................................
6.
C is strongly typed, i.e., variables/constants have a certain data type.
(True , False)
7.
In C programming language, it is necessary to declare variables before use. (True , False)
8.
Modulus operator (%) can be applied to variable of type float (True , False)
9.
The while loop usually runs its statements at least zero or more times. (True , False)
10.
The for loop does allows initialization of the counter variable. (True , False)
Explanation / Answer
6.true
7.true
8.false
9.false
10.true
11.true
12.true
13.true
14.false
15.true
16.true
17.true
18.false
19.true
20.true
3.
a.(i)first (ii)second (iii)add
b.integer
c.11
d.10
e.4
f.
loop starts with 0 and until it reached 11 elements it stops
it same in all the for loops
thank you.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.