logo

Crowdly

Browser

Add to Chrome

Questions Bank (1372343 total)

What will be the output of the following code?

#include <iostream>

using namespace std;

int main() {

int arr[] = {10, 20, 30, 40};  

int *ptr = arr;  

cout << *(ptr + 2);

    return 0;

}

0%
100%
0%
0%
View this question
What will be the output of the following code?

#include <iostream>

using namespace std;

int main() {

    int num=0x1234567;

    unsigned char *byte_ptr = (unsigned char *)&num;

    for (int i = 0; i < sizeof(num); i++) {

        cout << hex << +byte_ptr[i] << " "; }

    return 0;

}

0%
0%
100%
0%
View this question
What will be the output of the following code?

#include <stdio.h>

#include <stdlib.h>

#include <iostream>

#include <string.h>

using namespace std;

int main() {

    int num = 45, num2;

    char str1[10], str2[10];

    sprintf(str1, "%d", num);

    strcpy(str2, str1);

    strcat(str2, "AD");

    sscanf(str2, "%x", &num2);

    printf("Converted number: %x\n", num2);

    return 0;

}

0%
9%
91%
0%
View this question
What will be the output of the following code?

#include <stdio.h>

#include <stdlib.h>

#include <iostream>

#include <string.h>

using namespace std;

int main() {

    int num = 45, num2;

    char str1[10], str2[10];

    sprintf(str1, "%d", num);

    strcpy(str2, str1);

    strcat(str2, "AD");

    num2 = atoi(str2);

    printf("Converted number: %X\n", num2);

    return 0;

}

100%
0%
0%
0%
View this question
Which of the following statements best describes polymorphism in object-oriented programming?
0%
0%
0%
100%
View this question
What is the size of the following structure on a 64-bit system?

#include <iostream>

using namespace std;

struct MyStruct {

    char a;

    int b;

    double c;

};

int main() {

    cout << sizeof(MyStruct);

    return 0;

}

0%
88%
13%
0%
View this question
What is the actual usable capacity of an SSD as 1 TB in an operating system?
13%
0%
0%
88%
View this question
What will be the output of the following code?

#include <iostream>

using namespace std;

int main() {

    int a = 5;

    cout << a++ * ++a;

    return 0;

}

0%
0%
100%
0%
View this question
Which of the following is true about inheritance in object-oriented programming?
100%
0%
0%
0%
View this question
Which of the following statements correctly describes the difference between static and dynamic memory allocation?
0%
0%
100%
0%
View this question