GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

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

Given two strings st1[], and st2[], implement a logic to com…

Given two strings st1[], and st2[], implement a logic to compare the two strings, without using the string.h library and it’s functions. Concentrate on your array logic, variables, and printf() statements. Assume both the strings are already declared and defined, and the size of input string is unknown. Sample output: For example, if st1[] = “Hello, How are you.” and st2[] = “Welcome to UTSA…” The strings are unequal.   Note: Using library string functions will give NO points.

Read Details

Posts pagination

Newer posts 1 … 1,002 1,003 1,004 1,005 1,006 … 80,283 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top