AmbitionBox

Discover Best Places to work in India

C Programming

C Programming Questions and Answers

Showing 1 - 5 of 5 questions

1

What is x in the following program?

#include < stdio . h >int main()
{
    typedefchar (*(*arrfptr[3])())[10];
    arrfptr x;
    return0;
}
a

x is a pointer

b

x is an array of three pointer

c

x is an array of three function pointers

d

Error in x declaration

correct answer c
Answer :

Option C

2

What will be the output of the program?

#includetypedefstruct error {int warning, err, exception;} ERROR;
int main()
{
    ERROR e;
    e.err=1;
    printf("%d\n", e.err);
    return0;
}
a

0

b

1

c

2

d

Error

correct answer b
Answer :

Option B

3
  1. #include <stdio.h>
  2. typedefstruct student
  3. {
  4. char*a;
  5. }stu;
  6. void main()
  7. {
  8. struct stu s;
  9.         s.a="hi";
  10. printf("%s", s.a);
  11. }
a

Compile time error

b

Varies

c

hi

d

h

correct answer a

Answer: Option A

4

What is the output of this C code?

  1. #include <stdio.h>
  2. typedefstruct student
  3. {
  4. char*a;
  5. }stu;
  6. void main()
  7. {
  8. struct student s;
  9.         s.a="hey";
  10. printf("%s", s.a);
  11. }
a

Compile time error

b

Varies

c

he

d

hey

correct answer d

Answer: Option D

5

What is the output of this C code?

  1. #include <stdio.h>
  2. typedefint integer;
  3. int main()
  4. {
  5. int i =10,*ptr;
  6. float f =20;
  7.         integer j = i;
  8.         ptr =&j;
  9. printf("%d\n",*ptr);
  10. return0;
  11. }

a

Compile time error

b

Undefined behaviour

c

Depends on the standard

d

10

correct answer d

Answer: Option D

Select a company to compare with

vs

Similar Companies