GATE CSE C Programming Practice Test – Data Types & Operators | Set 1

Questions 86-90 of 100

Your score 0/100 0 answered
Correct 0 Incorrect 0 Unanswered 100 Accuracy 0%

Question 86

NAT · Numerical Answer 1 mark

What is the output value of 'count' after executing the following C code?

C
#include <stdio.h>
int main(void) {
    int n = 29;
    int count = 0;
    while (n) {
        count++;
        n &= (n - 1);
    }
    printf("%d", count);
    return 0;
}
Answers for question 86

Question 87

NAT · Numerical Answer 1 mark

What is the value printed by this program?

C
#include <stdio.h>
int fun(int n) {
    if (n == 0) return 1;
    return n * fun(n - 1);
}
int main(void) {
    printf("%d", fun(5));
    return 0;
}
Answers for question 87

Question 88

NAT · Numerical Answer 1 mark

Consider an array declared as 'int arr[4][5];' on a system where 'int' occupies 4 bytes. Assuming the base address of 'arr' is 1000, what is the memory address of 'arr[2][3]' in decimal?

Answers for question 88

Question 89

NAT · Numerical Answer 1 mark

What is the decimal output of the following bitwise expression: '15 ^ 9'?

Answers for question 89

Question 90

NAT · Numerical Answer 1 mark

What value is returned by calling 'sum(4)'?

CODE
int sum(int n) {
    if (n <= 0) return 0;
    return n + sum(n - 1);
}
Answers for question 90
Scroll to Top