Lab Exercise 2 - Copy

Download Lab Exercise 2 - Copy

Post on 12-Oct-2015

14 views

Category:

Documents

0 download

TRANSCRIPT

<ul><li><p>Lab Exercise 2 VARIABLES AND CONSTANTS </p><p>1. Name the best data type for the following variables: ( integer, float, char, string ) </p><p>a) Area of a circle in square inches b) Number of cars passing by c) CGPA d) Age e) Salary f) Student Name g) Body Weight h) Height i) Distance j) Number of Cars k) Car Plate Number l) Book Price m) Dividend Calculation n) Grade ( A, B, C, D ) </p><p>2. Which variables below are syntactically correct? ( cannot start with no, cannot be keyword, cannot contain other than digit, alphabet and underscore ) </p><p>a) income b) 1time c) intToms d) Two fold e) c3po f) income#1 g) item </p><p> 3. Which of the following is not a datatype in C. </p><p>A. bool B. char C. float D. double 4. What happen when you declare a variable? </p><p>A. The variable can no longer be used. B. The data type can no longer be used. C. The variable MUST be used in the program. D. Memory is reserved for that variable. </p></li><li><p> 5. What happen when you initialize a variable? </p><p>A. You make it constant for the first time. B. The value is printed for the first time. C. You give it a value for the first time. D. You give it a value for the last time. </p></li></ul>

Recommended

View more >