Knowee
Questions
Features
Study Tools

VariablesWhat will be the status of this program upon compilation? #include <stdio.h>int main() {   int i;   i = 10;   int I = 20;   printf("Values i = %d and I = %d\n", i, I);   getchar();   return 0;}OptionsWill run successfully and display the following, Values i = 20 and I = 10Error in compilationWill run successfully and display the following, Values i = 10 and I = 20Garbage Values

Question

VariablesWhat will be the status of this program upon compilation? #include <stdio.h>int main() {   int i;   i = 10;   int I = 20;   printf("Values i = %d and I = %d\n", i, I);   getchar();   return 0;}OptionsWill run successfully and display the following, Values i = 20 and I = 10Error in compilationWill run successfully and display the following, Values i = 10 and I = 20Garbage Values

🧐 Not the exact question you are looking for?Go ask a question

Solution

The program will compile and run successfully, displaying the following: "Values i = 10 and I = 20". This is because in C, variable names are case-sensitive, so "i" and "I" are considered two different variables.

Similar Questions

VariablesWhat will be the status of this program upon compilation?#include <stdio.h>/* integer variable program */int main() { int i; i = 10; printf("Value of i is %d\n", i); i = 20; printf("Value of i is %d\n", i); getchar(); return 0;}OptionsWill run successfully and display the following,Value of i is 10Value of i is 10Error in compilationWill run successfully and display the following,Value of i is 10Value of i is 20Garbage Values

VariablesWhat will be the status of this program upon compilation?#include <stdio.h>int main() {  char j = 'a';  int i = j;  int k = (int)j;  int l = 75;  char m = (char)l;  printf("value of i = %d, k = %d\n", i, k);   printf("value of l = %d, m = %c\n", l, m);   getchar();  return 0;}OptionsError in compilationvalue of i = 97, k = 97value of l = 75, m = KNo Outputvalue of i = 'a', k = 97value of l = 75, m = '7

lesWhat will be the status of this program upon compilation? #include <stdio.h>int main() {   int i;   i = 10;   int I = 20;   printf("Values i = %d and I = %d\n", i, I);   getchar();   return 0;}

What happens if we compile the following code?

ablesWhat will be the status of this program upon compilation?#include <stdio.h>int main() {  char j = 'a';  int i = j;  int k = (int)j;  int l = 75;  char m = (char)l;  printf("value of i = %d, k = %d\n", i, k);   printf("value of l = %d, m = %c\n", l, m);   getchar();  return 0;}

1/4

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.