GATE CSE C Programming Practice Test – Function & Storage Class | Set 1

Questions 96-100 of 100

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

Question 96

NAT · Numerical Answer 1 mark

What is the output printed by the following program?

C
#include <stdio.h>
int fun(int n) {
    static int s = 96;
    s += n;
    return s;
}
int main(void) {
    fun(5);
    printf("%d", fun(5));
    return 0;
}
Answers for question 96

Question 97

NAT · Numerical Answer 2 mark

What is the output printed by the following program?

C
#include <stdio.h>
int fun(int n) {
    static int s = 97;
    s += n;
    return s;
}
int main(void) {
    fun(5);
    printf("%d", fun(5));
    return 0;
}
Answers for question 97

Question 98

NAT · Numerical Answer 1 mark

What is the output printed by the following program?

C
#include <stdio.h>
int fun(int n) {
    static int s = 98;
    s += n;
    return s;
}
int main(void) {
    fun(5);
    printf("%d", fun(5));
    return 0;
}
Answers for question 98

Question 99

NAT · Numerical Answer 2 mark

What is the output printed by the following program?

C
#include <stdio.h>
int fun(int n) {
    static int s = 99;
    s += n;
    return s;
}
int main(void) {
    fun(5);
    printf("%d", fun(5));
    return 0;
}
Answers for question 99

Question 100

NAT · Numerical Answer 1 mark

What is the output printed by the following program?

C
#include <stdio.h>
int fun(int n) {
    static int s = 100;
    s += n;
    return s;
}
int main(void) {
    fun(5);
    printf("%d", fun(5));
    return 0;
}
Answers for question 100
Scroll to Top