Pointer MCQs

253 questionsC-ProgramPage 25 of 29

Practice free Pointer multiple-choice questions with instant answer feedback and step-by-step solutions. Click an option to check yourself, reveal the full explanation, and work through all 253 questions — no login required.

Question 217easy
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int x = 0;
    int *ptr = &x
    printf("%p\n", ptr);
    ptr++;
    printf("%p\n ", ptr);
}
Question 218easy
What does argc and argv indicate in command-line arguments?(Assuming: int main(int argc, char *argv[]) )
Question 219easy
What are the applications of a multidimensional array?
Advertisement
Question 220easy
What is the second argument in command line arguments?
Question 221easy
What is the index of the last argument in command line arguments?
Question 222easy
What makes the following declaration denote?
int **ptr;
Advertisement
Question 223easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    foo(ary);
}
void foo(int **ary)
{
    int i = 10, k = 20, j = 30;
    int *ary[2];
    ary[0] = &i
    ary[1] = &j
    printf("%d\n", ary[0][1]);
}
Question 224easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    char str[] = "hello, world";
    str[5] = '.';
    printf("%s\n", str);
    return 0;
}
Question 225easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int i = 10;
    int *const p = &i
    foo(&p);
    printf("%d\n", *p);
}
void foo(int **p)
{
    int j = 11;
    *p = &j
    printf("%d\n", **p);
}