Call
whatsapp
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
Cisco Training in Trivandrum, Trinity Technologies

No.1 Training Institute in Kerala

C PROGRAM QUESTIONS : PART 11

What will be the output of the following C code?
    #include <stdio.h>
    void foo();
    int main()
    {
        void foo();
        foo();
        return 0;
    }
    void foo()
    {
        printf("2 ");
    }

Compile time error
 2
Depends on the compiler
Depends on the standard
SHOW ANSWER

What will be the output of the following C code?
    #include <stdio.h>
    void foo();
    int main()
    {
        void foo(int);
        foo(1);
        return 0;
    }
    void foo(int i)
    {
        printf("2 ");
    }

2
Compile time error
 Depends on the compiler
 Depends on the standard
SHOW ANSWER

What will be the output of the following C code?
    #include <stdio.h>
    void foo();
    int main()
    {
        void foo(int);
        foo();
        return 0;
    }
    void foo()
    {
        printf("2 ");
    }

2
Compile time error
Depends on the compiler
 Depends on the standard
SHOW ANSWER

What will be the output of the following C code?
    #include <stdio.h>
    void m()
    {
        printf("hi");
    }
    void main()
    {
        m();
    }

hi
Run time error
Nothing
Varies
SHOW ANSWER

What will be the output of the following C code?
    #include <stdio.h>
    void m();
    void n()
    {
        m();
    }
    void main()
    {
        void m()
        {
            printf("hi");
        }
    }

hi
Compile time error
 Nothing
 Varies
SHOW ANSWER

What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
        m();
        void m()
        {
            printf("hi");
        }
    }

hi
Compile time error
 Nothing
 Varies
SHOW ANSWER

What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
        m();
    }
    void m()
    {
        printf("hi");
        m();
    }

Compile time error
hi
Infinite hi
Nothing
SHOW ANSWER

What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
        static int x = 3;
        x++;
        if (x <= 5)
        {
            printf("hi");
            main();
        }
    }

Run time error
 hi
 Infinite hi
hi hi
SHOW ANSWER

Which of the following is a correct format for declaration of function?

return-type function-name(argument type);
 return-type function-name(argument type){}
return-type (argument type)function-name;
all of the mentioned
SHOW ANSWER

 Which of the following function declaration is illegal?

int 1bhk(int);
 int 1bhk(int a);
int 2bhk(int*, int []);
 all of the mentioned
SHOW ANSWER

Which function definition will run correctly?

int sum(int a, int b)
   return (a + b);

   int sum(int a, int b)
   {return (a + b);}

   int sum(a, b)
   return (a + b);
 none of the mentioned
SHOW ANSWER

The value obtained in the function is given back to main by using ________ keyword.

return
static
 new
volatile
SHOW ANSWER

What will be the output of following program ?
#include <stdio.h>
int main()
{
    int var=100;
    {
        int var=200;
        printf("%d...",var);
    }
    printf("%d",var);
    return 0;
}

ERROR
200...200
00...100
200...100
SHOW ANSWER
BACK | NEXT
TRINITY SOFTWARE SOLUTIONS,IInd floor, Radheyam Towers, Gandhari Amman Kovil Road, Pulimood, Trivandrum - 1
0471-2334855 | 2335855 | 9447387064 | 9847003556 info@trinitytechnology.in