please help me Lab: Introduction to Computers Code: ENGR 103 Quiz [30 points]: A
ID: 3726274 • Letter: P
Question
please help me
Lab: Introduction to Computers Code: ENGR 103 Quiz [30 points]: Answer ALL Questions Instructor: Dr. Vidhyacharan Bhaskar Date: March 08, 2018 Time duration: 1 hour 30 min A. 1. 2. Say True or False [5 points] int main 01) is a complete and correct C program printf and main are C tokens The format specification for an int type data should not contain a decimal point and precision, 968.2d is illegal. 4 The statement printf("%-3d",123); displays-123 5The result of an integer division is a rounded result. B. Choose the best answers (more than one may be correct for some cases): [5 points] 1. Which of the following are illegal identifiers? 2. Which of the following are incorrect C assignment statements? 3 The unary operator ~ does which of the following functions? 4· The condition gr(valid) means 5· The assignment statement a-b-c + d sunplifies to a. dogs2 a. year 1967; b. day 24 hours; a. 2s complement b. 1s complement c. negative of a number d. modulo two a. if (valid ,-0) b. if (!valid0) c. if (valid-0) d. if (!valid I-0) a. a-b+1c + d); b, a _ b + (b + c + d); e, a (b _ b + (c + d));da-b-(b=c+d) b. cat number c, pears-3 d, area% c. year - days 365 d. while- 32; C. Mateh the following Escape characters with their corresponding ASClU values given in hexadecima notation: [5 points] a. VTAB BELL 2. x22 1x22 3. "x9 c. BACKSLASH d. GARRIAGE RETURN e. FORMFEED f. BACKSPACE g. HTAB h. SINGLE QUOTES . DOUBLE QUOTES j. QUESTION MARK 6·1x3F. D. Find the syntax errors in the following piece of code fragments: [5 points] a. char msg-"warning: b, for (m 0, mExplanation / Answer
A) 1. True (For C Programming main function is heart. without main function, the program doesn't execute)
2. False, they are not tokens it's a identifiers.
3. False, we can that type also, but no use it prints as like %d.
4.False, "%-3d" where 3 is width and - is for left alignment
5.False, It's rounding to floor
B.
1 area% - identifier doesn't have any symbols except _
2. B, C and D
3. C
4. A (valid!=0)
5. C
C)
a - 9, b - 7, c - 4, d - 5, e - 8, f - 10, g - 3, h - 1, i - 2, j - 6
D)
a) char msg[] = "warning";
b) for(m=0; m<n; m++, n++);
c) z = (a>b)?a:b;
d) while((c=getchar())!=' ');
e) i=1;
do{
i=i*2;
i++;
}while(i<100);
E)
a) #include<stdio.h> it's printing nothing, it is just header file... it contains standard input output predeined functons
b) It's printing 1 to 4 numbers if we give printf statement.
c) the variables x and y have 2 and 4 values respectively...
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.