GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

What is the output of the following code?   int i = 0;for (i…

What is the output of the following code?   int i = 0;for (i = 0; i < 20; i++){  switch(i){    case '0':        i += 1;    case '1':        i += 2;    case '5':        i += 3;    default:        i += 4;        break;}printf("%d ", i); }

Read Details

Which is the correct way to declare a for loop in C?

Which is the correct way to declare a for loop in C?

Read Details

True or False? The following code is how you’re supposed to…

True or False? The following code is how you’re supposed to compare two strings? if( str1 == str2 ) { printf( “These two strings are equal.\n” ); }

Read Details

What is the format specifier for a double?

What is the format specifier for a double?

Read Details

What is the output of the following code? int c = 5, n = 10…

What is the output of the following code? int c = 5, n = 10;do{  n /= c; } while ( c– ); printf(“%d”, n); 

Read Details

What is the default name of the executable generated from gc…

What is the default name of the executable generated from gcc?

Read Details

What does the following code print out? int x; printf( “%d”,…

What does the following code print out? int x; printf( “%d”, x );

Read Details

Predict the Output: int x = 1;switch(x) {    case 1:       …

Predict the Output: int x = 1;switch(x) {    case 1:        printf(“A”);    case 2:        printf(“B”); break;    default:        printf(“C”);} Explain what is printed and why? Consider the code is fully formed, i.e., no excuses like missing main(), missing stdio.h, etc.

Read Details

What is the output of the following code? #include#includein…

What is the output of the following code? #include#includeint main(int argc, char *argv[]){    char str1[] = “hello world”;    char str2[] = “hello world”;    if (strcmp(str1, str2))        printf(“equal”);    else        printf(“unequal”);}

Read Details

Consider this code to get user input for a string: char str…

Consider this code to get user input for a string: char str[ 3 ]; scanf( “%s”, str ); What happens if the user enters a string that is 100 characters long?

Read Details

Posts pagination

Newer posts 1 … 7,300 7,301 7,302 7,303 7,304 … 86,582 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top