GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

What is the output of the following code?  char fruit[3][7]…

What is the output of the following code?  char fruit[3][7] = {“Apple”, “Pear”, “Orange”}; printf(“%c”, fruit[1][2]);

Read Details

How many bytes are read assuming file.bin has at least 16 by…

How many bytes are read assuming file.bin has at least 16 bytes?  FILE *fp = fopen(“file.bin”, “rb”); char buf[4]; size_t n = fread(buf, 1, 4, fp); printf(“%zu”, n); fclose(fp);

Read Details

What is wrong with this code?  struct Student { char name[50…

What is wrong with this code?  struct Student { char name[50]; int age; }; Student s1;

Read Details

What is the output of the following code?  printf(“%d”, size…

What is the output of the following code?  printf(“%d”, sizeof(char) – strlen(“sidewalk”));

Read Details

What is the output of the following code?  char str1[] = “He…

What is the output of the following code?  char str1[] = “Hello”; char str2[] = “hello”; printf(“%d”, strcmp(str1, str2));

Read Details

What is the output of the following code?  struct Point { in…

What is the output of the following code?  struct Point { int x, y; }; struct Point points[2] = {{10, 20}, {30, 40}}; struct Point *p = points; printf(“%d”, (p+1)->x);

Read Details

What is the output of the following code?  int nums[3][3] =…

What is the output of the following code?  int nums[3][3] = {{10, 20, 30}, {40, 50, 60}, {70, 80, 90}}; printf(“nums[1][2] = %d *(* (nums + 1) + 2) = %d\n”, nums[1][2], *(*(nums + 1) + 2));

Read Details

What is the output of the following code?  char str1[] = “te…

What is the output of the following code?  char str1[] = “test string”; char *ptr = strchr(str1, ‘t’); printf(“%ld”, ptr – str1);

Read Details

Which of the following allocates memory for a 2D array of in…

Which of the following allocates memory for a 2D array of int (5×5)?

Read Details

What is the output of the following code if file.txt contain…

What is the output of the following code if file.txt contains:  line1 line2 FILE *fp = fopen(“file.txt”, “r”); char str[10]; fgets(str, 10, fp); printf(“%s”, str); fclose(fp);

Read Details

Posts pagination

Newer posts 1 … 37,323 37,324 37,325 37,326 37,327 … 94,765 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top