44.
What will be the output of the following C code?
#include <stdio.h>
#include <string.h>
int main()
{
    char *str = "x";
    char c = 'x';
    char ary[1];
    ary[0] = c;
    printf("%d %d", strlen(str), strlen(ary));
    return 0;
}

47.
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int x = 3, i = 0;
    do {
        x = x++;
        i++;
    } while (i != 3);
    printf("%d\n", x);
}

49.
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int a = 5, b = -7, c = 0, d;
    d = ++a && ++b || ++c;
    printf("\n%d%d%d%d", a, b, c, d);
}

50.
What will be the output of the following C code?
#include <stdio.h>
void foo(const int *);
int main()
{
    const int i = 10;
    printf("%d ", i);
    foo(&i);
    printf("%d", i);

}
void foo(const int *i)
{
    *i = 20;
}

Read More Section(C Fundamentals)

Each Section contains maximum 100 MCQs question on C Fundamentals. To get more questions visit other sections.