Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Read following C program, and answer question 6) to 7) int func( int arr[], int n) { int result = 0, i = 0; for

Read following C program, and answer question 6) to 7) int func( int arr[], int n) { int result = 0, i = 0; for ( i = 0; i result ^= arr[i]; return result; } 6) What value will be returned if the function call is func(arr,5) while the passed array has elements 1,2,2,3 and 3 in it? (a) 1 (b) 2 (c) 5 (d) None of above 7) What does the function func do? (a) Get the first element from the array. (b) Count the number of elements in the array. (c) Remove pairs of elements with the same value from the array. (d) None of above 8) Assume 'A' has a ASCII code 65, i is an int type variable and has a value 2, c is a char type variable, so after the execution of c='A'+011, The value of c is: (a) 'D' (b) 68 (c) 'C' (d) None of above 9) Which statement below is not equivalent to the other two (assuming that the loop bodies are the same)? (a) for(n=0; n<10; n++) (b) for(n=0; n<10; ++n) (c) for(n=1; n<=10; n=n+1) (d) for(n=0; n++<10; ) 10) Assume that a program contains the following declarations ? char c=65; int i=2; double d = 5.5; Give the date type of following expressions; (1) (c+i)/d (2) d-c (3) c*I

(a) double, double, int (b) int, double, int (c) int, double, char (d) None of above

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions