Time Left - 15:00 mins

Pointers and Arrays-I Starter Quiz-1

Attempt now to get your rank among 98 students!

Question 1

Consider a 2D array A[-5….5][10……15], the base address is 100 and word length 2B find the address of the element A[2][13] using Row major order?

Question 2

int test(*a,*b)

{

*a = *b;

*b = *a;

}

int main()

{

int x,y;

X=4;

Y=5;

test(&y, &x);

return 0;

}

What will be the final value of x and y?

Question 3

#include <stdio.h>

void main (void)

{

char name [] =”Harry Potter”;

printf (“%c”,*name);

}

The output of the above program is?

Question 4

Let p be a char pointer. Consider the following statements:

I. p[i] = *(i + p)

II. i[p] = *(p + i)

III. p + i = &(i[p])

The number of correct statements are ________

Question 5

Consider the following C program

What is the output of the above program?

Question 6

Consider the below given code:

#include<stdio.h>
int main()
{
            char grade[] = "GATE_CS 2023";
            char t[20];
            scanf("%s",t);
            printf("%s -> ", grade);
            print("%s",t);
            return 0;
}

What is the output if the input is BYJUS EP?

Question 7

What is the output of the following C program?

  • 98 attempts
  • 0 upvotes
  • 5 comments
Jun 29GATE & PSU CS