Which is valid C expression?Answer areaa) int my_num = 100,000;b) int my_num = 100000;c) int my num = 1000;d) int $my_num = 10000;
Question
Which is valid C expression?
Answer are
a) int my_num = 100,000;
b) int my_num = 100000;
c) int my num = 1000;
d) int $my_num = 10000;
Solution
The valid C expression among the given options is:
b) int my_num = 100000;
Explanation:
a) int my_num = 100,000; - This is not valid because in C language, we cannot use comma in a number.
b) int my_num = 100000; - This is a valid C expression. It declares an integer variable named my_num and initializes it with the value 100000.
c) int my num = 1000; - This is not valid because in C language, we cannot have spaces in a variable name.
d) int $my_num = 10000; - This is not valid because in C language, variable names cannot start with a dollar sign.
Similar Questions
What will the result of num variable after execution of the following statements? int num = 58; num % = 11; the given code is in c
What will be the output of following program?main( ){int k, num = 30 ;k = ( num > 5 ? ( num <= 10 ? 100 : 200 ) : 500 ) ;printf ( "\n%d", num ) ;}
Select the correct answerWhich of the following is an invalid statement?Optionsc,o,d = 2000, 3000, 4000c o d = 2000 3000 4000cod = 2,000,000c_o_d = 2,000,000
What will the result of num1 variable after execution of the following statements? int j = 1, num1 = 4; while (++j <= 10) { num1++; } ans.
Which of the following expressions are valid in C++Select one or more:a.None of the aboveb.a = 11 % 3c.a = 2 + (b = 5);d.a = b = c = 5;
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.