1. Which of the following are valid variable names in C? a. char b. limit7e c. 1
ID: 3724320 • Letter: 1
Question
1. Which of the following are valid variable names in C? a. char b. limit7e c. 1234 d. count_of apples_in_one_basket e. $2000_address_for_input 2. Please write the output of the following code segments: r=x%y; printf( "q = r); %d ", 8; %d, r q, = b, int x -30, y = double q x / (double) y; printf("q 1f ", q); C. Char x= 'T', r; printf("r = %c ", r); d, int x=2; switch (x) f case 3 printf("Level A! "); break; printf( "Level B!n); printf("Level C! ") case 2: case 1: break; int x 3; while (x >= 0) { if(x % 2 == 0) else if (x *xx) printf("%d is even ", x); printf("%d is odd ", x); break;Explanation / Answer
1).
a). char ===>> Invalid (Because language keywords cannot be used as variable name )
b). limit70 ====>>> Valid (Because a variable name can start from either lower or upper letter)
c). _1234 ====>> Valid (Because a variable name can start from underscore( _ ) )
d). count_of_apples_in_one_basket ===>> Valid (Because a variable name can start from either lower or upper letter and underscore( _ ) )
e). $2000_address_for_input ====> Invalid ( $ is not allowed )
2). a. q = - 3, r = - 6
b. q = - 3.750000
c. r = R
d.
Level B!
Level C!
e).
3 is odd
2 is even
1 is odd
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.