Lab: Introduction to Computers Code: ENGR 103 Quiz [30 points): Answer ALL Quest
ID: 3726275 • Letter: L
Question
Lab: Introduction to Computers Code: ENGR 103 Quiz [30 points): Answer ALL Questions Date: March 08, 2018 Time duration: 1 hour 30 min A. Say True or False [5 points) 1. int main O () is a complete and correct C program 2. printf and main are C tokents 3. The format specification for an int type data should not contain a decimal point and precision, %8.2d is illegal. 4. The statement printf("%-3d", 125); displays-125 5. The result of an integer division is a rounded result. B. Choose the best answers (more than one may be correct for some cases) : [s points) a. dogs2 b, cat number c.pears-3 d.area% 2. Which of the following are incorrect C assignment statements? Seyear - days 365; d. while 32; d. modulo two a year- 1967; b. day 24 hours The unary operator-does which of the following functions? b. 1s complement 3. 4 5· c.negative of a number c. if(valid0) a 2s complement The condition (Walid) means if(valid !-0) b. if(!valid-0) d. if(!valid !-0) a. The assignment statement a = b +-c + d simplifies to Match the following Escape characters with their corresponding ASCII values given in hexadecimal notation: [5 points] C. a VTAB b. BELL c. BACKSLASH d. GARRIAGE RETURN4. "x5C e. FORMFEED f BACKSPACE & HTAEB h SINGLE QUOTES 2. "x22" i. DOUBLE QUOTES J QUESTION MARK D. Find the syntax errors in the following piece of code fragments: [5 points) a b, char msg = "warning: ". for (m = 0; mExplanation / Answer
Solution:
The first question is done as per Chegg guidelines, please repost others.
A)
1)
True
It is a complete program, it should also return some int value, but it will work fine.
2)
True, they are keywords which comes under tokens
3)
True
4)
False
Example:
#include<stdio.h> //i/o library
int main(){
/ printf("%-3d", 123);
return 0; //This is to make sure that the program terminates
}
will print 123
5)
True
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.