C Questions


Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-content/plugins/quiz-maker/public/class-quiz-maker-public.php on line 1335

Deprecated: Implicit conversion from float 0.16666666666666666 to int loses precision in /home/u797631661/domains/codermantra.com/public_html/wp-content/plugins/quiz-maker/includes/class-quiz-maker-data.php on line 1008

Deprecated: Implicit conversion from float 0.16666666666666666 to int loses precision in /home/u797631661/domains/codermantra.com/public_html/wp-content/plugins/quiz-maker/includes/class-quiz-maker-data.php on line 1008

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449
0 votes, 0 avg
621

C Questions

1 / 15

1. What will be the output of the following C code?

        #include 

        int f(char chr, ...);

        int main()

        {

            char c = 97;

            f(c);

            return 0;

        }

        int f(char c, ...)

        {

            printf("%cn", c);

        }

2 / 15

2. What will be the output of the following C code?

       #include 
        int main()
        {
            int i = 0;
            do
            {
               i++;
                if (i == 2)
                    continue;
                    printf("In while loop ");
            } while (i < 2);
            printf("%dn", i);

        }

3 / 15

3. Which of the following is the correct syntax to declare a 3 dimensional array using pointers?

4 / 15

4. double ______ (double x, double y) computes the floating-point remainder of x/y.

5 / 15

5. What will be the output of the following C code?

        #include 

        void main()

        {

            int a[2][3] = {1, 2, 3, , 4, 5};

            int i = 0, j = 0;

            for (i = 0; i < 2; i++)

            for (j = 0; j < 3; j++)

            printf("%d", a[i][j]);

        }

6 / 15

6. What will fopen will return, if there is any error while opening a file?

7 / 15

7. What is storage class for variable A in below code?


int main()
{
int A;
A = 10;
printf("%d", A);
return 0;
}

8 / 15

8. What will be the output of the following C code?

#include 

int main(){
    int a = 11;
    
    while (a < 20) {
        printf("%d  ", a);
        a += 2;
    }
    
    return 0;
}

9 / 15

9. What is the use of symbol * in the control string as shown [=%[*][width] [modifiers] type=]?

10 / 15

10. What will be the output of the following code snippet?

#include 
int main() {
	int a = 3, b = 5;
	int t = a;
	a = b;
	b = t;
	printf("%d %d", a, b);
	return 0;
}

11 / 15

11. The concept of two functions with same name is know as?

12 / 15

12. What will be the output of the following code snippet?

#include 
void solve() {
    int a[] = {1, 2, 3, 4, 5};
    int sum = 0;
    for(int i = 0; i < 5; i++) {
        if(i % 2 == 0) {
            sum += *(a + i);
        }
        else {
            sum -= *(a + i);
        }
    }
    printf("%d", sum);
}
int main() {
solve();
return 0;
}

13 / 15

13. How many times i value is checked in the following C program?

        #include 

        int main()

        {

            int i = 0;

            while (i < 3)

                i++;

            printf("In while loopn");

        }

14 / 15

14. What will be the output of the following C code?

        #include 

        struct student

        {

            char *name;

        };

        struct student s[2];

        void main()

        {

            s[0].name = "alan";

            s[1] = s[0];

            printf("%s%s", s[0].name, s[1].name);

            s[1].name = "turing";

            printf("%s%s", s[0].name, s[1].name);

        }

15 / 15

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

Your score is

The average score is 39%

0%