Log In Register

Units


Functions Returning Non-integers - Questions and Answers

 

Practice these Functions Returning Non-integers under C Programming walk-in interview Questions/ examination questions with best tricks and short cuts with solution. Student (candidate) who want to crack the walk in interview, competitive exams and want to find short cuts and tricks to solve questions on Functions Returning Non-integers for following purpose.


– Anyone who is wishing to increase their perfect knowledge of Functions Returning Non-integers of C Programming.
– Anyone who is preparing for aptitude test and increase his in depth aptitude knowledge C Programming specifically Functions Returning Non-integers.
– Anyone who is preparing for interviews (competitive examinations, govt examinations and bank examinations, off-campus or on campus interviews, walk-in interview and company interviews) having questions on Functions Returning Non-integers under C Programming.

– Anyone who is preparing for aptitude test or competitive exam or entrance exam.
– Anyone who is preparing for entrance examinations and other competitive examinations.
– All Experienced, Freshers and Students.

Here is list of Questions and Answers covering all key area of  Functions Returning Non-integers topic of C Programming:

 

1.

functions can return structure in c?

Answer: Option D

Explanation:

2.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int foo();
  3.     int main()
  4.     {
  5.         int i = foo();
  6.     }
  7.     foo()
  8.     {
  9.         printf("2 ");
  10.         return 2;
  11.     }

Answer: Option D

Explanation:

3.

The output of the code below is

  1.     #include <stdio.h>
  2.     int *m();
  3.     void main()
  4.     {
  5.         int *k = m();
  6.         printf("hello ");
  7.         printf("%d", k[0]);
  8.     }
  9.     int *m()
  10.     {
  11.         int a[2] = {5, 8};
  12.         return a;
  13.     }

Answer: Option B

Explanation:

4.

he output of the code below is

  1.     #include <stdio.h>
  2.     int *m();
  3.     void main()
  4.     {
  5.         int k = m();
  6.         printf("%d", k);
  7.     }
  8.     int *m()
  9.     {
  10.         int a[2] = {5, 8};
  11.         return a;
  12.     }

Answer: Option A

Explanation:

5.

What is the problem in the following declarations?
    int func(int);
    double func(int);
    int func(float);

Answer: Option D

Explanation:

6.

The output of the code below is

  1.     #include <stdio.h>
  2.     int *m()
  3.     {
  4.         int *p = 5;
  5.         return p;
  6.     }
  7.     void main()
  8.     {
  9.         int *k = m();
  10.         printf("%d", k);
  11.     }

Answer: Option B

Explanation:

7.

What is the output of code given below?

  1.     #include <stdio.h>
  2.     enum m{JAN, FEB, MAR};
  3.     enum m foo();
  4.     int main()
  5.     {
  6.         enum m i = foo();
  7.         printf("%d\n", i);
  8.     }
  9.     int  foo()
  10.     {
  11.         return JAN;
  12.     }

Answer: Option D

Explanation:

8.

The output of the code below is

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         int k = m();
  5.         printf("%d", k);
  6.     }
  7.     void m()
  8.     {
  9.         printf("hello");
  10.     }

Answer: Option D

Explanation:

9.

What is the default return type if it is not specified in function definition?

Answer: Option C

Explanation:

10.

functions can return enumeration constants in c?

Answer: Option C

Explanation:

11.

The output of the code below is

  1.     #include <stdio.h>
  2.     void m(int k)
  3.     {
  4.         printf("hi");
  5.     }
  6.     void m(double k)
  7.     {
  8.         printf("hello");
  9.     }
  10.     void main()
  11.     {
  12.         m(3);
  13.     }

Answer: Option B

Explanation:

12.

What will be the data type returned for the following function?

  1.     #include <stdio.h>
  2.     int func()
  3.     {
  4.         return (double)(char)5.0;
  5.     }

Answer: Option C

Explanation:

13.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     double foo();
  3.     int main()
  4.     {
  5.         foo();
  6.         return 0;
  7.     }
  8.     foo()
  9.     {
  10.         printf("2 ");
  11.         return 2;
  12.     }

Answer: Option C

Explanation:

14.

What is the return-type of the function sqrt()

Answer: Option B

Explanation:

15.

What is the output of this code having void return-type function?

  1.     #include <stdio.h>
  2.     void foo()
  3.     {
  4.         return 1;
  5.     }
  6.     void main()
  7.     {
  8.         int x = 0;
  9.         x = foo();
  10.         printf("%d", x);
  11.     }

Answer: Option A

Explanation: