C BASICS QUIZ (DATA TYPES & OPERATORS). C language has been developed by (1) Ken Thompson (2) Dennis Ritchie (3) Peter Norton (4) Martin Richards.

Slides:



Advertisements
Similar presentations
CSE202: Lecture 2The Ohio State University1 Variables and C++ Data Types.
Advertisements

C Programming Language 4 Developed in 1972 by Dennis Ritchie at AT&T Bell Laboratories 4 Used to rewrite the UNIX operating system 4 Widely used on UNIX.
Data types and variables
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie June 27, 2005.
Overview of C++ Chapter 2 in both books programs from books keycode for lab: get Program 1 from web test files.
Basic Elements of C++ Chapter 2.
C Programming. Chapter – 1 Introduction Study Book for one month – 25% Learning rate Use Compiler for one month – 60%
Identifiers and Assignment Statements. Data structures In any programming language you need to refer to data The simplest way is with the actual data.
Copyrights© 2008 BVU Amplify DITM Software Engineering & Case Tools Page:1 INTRODUCTION TO ‘C’ LANGUAGE Chapter 2.
The Data Element. 2 Data type: A description of the set of values and the basic set of operations that can be applied to values of the type. Strong typing:
Objectives You should be able to describe: Data Types
A First Book of ANSI C Fourth Edition
 2003 Prentice Hall, Inc. All rights reserved. 1 Introduction to C++ Programming Outline Introduction to C++ Programming A Simple Program: Printing a.
The Data Element. 2 Data type: A description of the set of values and the basic set of operations that can be applied to values of the type. Strong typing:
A Variable is symbolic name that can be given different values. Variables are stored in particular places in the computer ‘s memory. When a variable is.
C Tokens Identifiers Keywords Constants Operators Special symbols.
Five Tips to Success. Work hard Try more exercises and more practice.
Sales person receive RM200/week plus 9% of their gross sales for that week. Write an algorithms to calculate the sales person’s earning from the input.
1 CSC103: Introduction to Computer and Programming Lecture No 6.
Computer Science 101 Introduction to Programming.
CPS120: Introduction to Computer Science
Lecture #5 Introduction to C++
Chapter 2. C++ Program Structure C++ program is a collection of subprograms Subprograms in C++ are called FUNCTIONS Each function performs a specific.
Constants Numeric Constants Integer Constants Floating Point Constants Character Constants Expressions Arithmetic Operators Assignment Operators Relational.
Course Title: Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
BASICS CONCEPTS OF ‘C’.  C Character Set C Character Set  Tokens in C Tokens in C  Constants Constants  Variables Variables  Global Variables Global.
What is C? C is a programming language. It was developed in 1972 USA. It was designed and written by a man named dennis ritchie. C is the base for all.
LOOP & Type Conversion. do – while Loop In the while loop, the test expression is evaluated at the beginning of the loop. If the test condition is false.
VARIABLES, CONSTANTS, OPERATORS ANS EXPRESSION
CHAPTER # 2 Part 2 PROGRAMS AND DATA 1 st semster King Saud University College of Applied studies and Community Service CSC1101 By: Asma Alosaimi.
CONSTANTS Constants are also known as literals in C. Constants are quantities whose values do not change during program execution. There are two types.
8-1 Compilers Compiler A program that translates a high-level language program into machine code High-level languages provide a richer set of instructions.
Constants, Variables and Data types in C The C character Set A character denotes any alphabet, digit or special symbol used to represent information.
Types of C Variables:  The following are some types of C variables on the basis of constants values it has. For example: ○ An integer variable can hold.
C++ Programming Lecture 3 C++ Basics – Part I The Hashemite University Computer Engineering Department (Adapted from the textbook slides)
Programming Fundamentals. Overview of Previous Lecture Phases of C++ Environment Program statement Vs Preprocessor directive Whitespaces Comments.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 2A Reading, Processing and Displaying Data (Concepts)
Topics to be covered  Introduction to C Introduction to C  Characterstics of C Characterstics of C  Characterset Characterset  Keywords Keywords 
CPS120: Introduction to Computer Science Variables and Constants.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
1 09/03/04CS150 Introduction to Computer Science 1 What Data Do We Have.
Tokens in C  Keywords  These are reserved words of the C language. For example int, float, if, else, for, while etc.  Identifiers  An Identifier is.
MAHENDRAN. Session Objectives Session Objectives  Discuss the Origin of C  Features of C  Characteristics of C  Current Uses of C  “C” Programming.
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Constants, Data Types and Variables
Chapter 3 Using Variables, Constants, Formatting Mrs. UlshaferSept
INTRODUCTION TO C LANGUAGE
Course Contents KIIT UNIVERSITY Sr # Major and Detailed Coverage Area
Chapter # 2 Part 2 Programs And data
Chapter Topics The Basics of a C++ Program Data Types
BASIC ELEMENTS OF A COMPUTER PROGRAM
ITEC113 Algorithms and Programming Techniques
Basic Elements of C++.
C Language VIVA Questions with Answers
' C ' PROGRAMMING SRM-MCA.
INTRODUCTION c is a general purpose language which is very closely associated with UNIX for which it was developed in Bell Laboratories. Most of the programs.
Basic Elements of C++ Chapter 2.
Introduction to C++ Programming
CS111 Computer Programming
Variables T.Najah Al_Subaie Kingdom of Saudi Arabia
Chapter # 2 Part 2 Programs And data
The Data Element.
The Data Element.
Lexical Elements & Operators
DATA TYPES AND OPERATIONS
C Programming Lecture-3 Keywords, Datatypes, Constants & Variables
Basic Programming Lab C.
Variables and Constants
Programming Fundamental-1
Presentation transcript:

C BASICS QUIZ (DATA TYPES & OPERATORS)

C language has been developed by (1) Ken Thompson (2) Dennis Ritchie (3) Peter Norton (4) Martin Richards

C can be used on (1) Only MS-DOS operating system (2) Only Linux operating system (3) Only Windows operating system (4) All the above

C programs are converted into machine language with the help of (1) An Editor (2) A compiler (3) An operating system (4) None of the above

The real constant in C can be expressed in which of the following forms (1) Fractional form only (2) Exponential form only (3) ASCII form only (4) Both fractional and exponential forms

A character variable can at a time store (1) 1 character (2) 8 characters (3) 254 characters (4) None of the above

The statement char ch = ‘Z’ would store in ch (1) The character Z (2) ASCII value of Z (3) Z along with the single inverted commas (4) Both (1) and (2)

Which of the following is NOT a character constant (1) ‘Thank You’ (2) ‘Enter values of P, N, R’ (3) ‘23.56E-03’ (4) All the above

The maximum value that an integer constant can have is (1) (2) (3) e+38 (4) –1.7014e+38

A C variable cannot start with (1) An alphabet (2) A number (3) A special symbol other than underscore (4) Both (2) & (3) above

Which of the following statement is wrong (1) mes = ; (2) con = 'T' * 'A' ; (3) this = 'T' * 20 ; (4) 3 + a = b ;

Which of the following shows the correct hierarchy of arithmetic operators in C (1) **, * or /, + or - (2) **, *, /, +, - (3) **, /, *, +, - (4) / or *, - or +

In b = 6.6 / a + 2 * n ; which operation will be performed first? (1) 6.6 / a (2) a + 2 (3) 2 * n (4) Depends upon compiler

Which of the following is allowed in a C Arithmetic instruction (1) [ ] (2) { } (3) ( ) (4) None of the above

Which of the following statements is false (1) Each new C instruction has to be written on a separate line (2) Usually all C statements are entered in small case letters (3) Blank spaces may be inserted between two words in a C statement (4) Blank spaces cannot be inserted within a variable name

If a is an integer variable, a = 5 / 2 ; will return a value (1) 2.5 (2) 3 (3) 2 (4) 0

The expression, a = 7 / 22 * ( ) * 3 / 5 ; evaluates to (1) 8.28 (2) 6.28 (3) 3.14 (4) 0

The expression, a = 30 * ; evaluates to (1) (2) (3) (4) 0

The expression x = % - 8 evaluates to (1) -6 (2) 6 (3) 4 (4) None of the above

Hierarchy decides which operator (1) is most important (2) is used first (3) is fastest (4) operates on largest numbers

An integer constant in C must have: (1) At least one digit (2) Atleast one decimal point (3) A comma along with digits (4) Digits separated by commas

A character variable can never store more than (1) 32 characters (2) 8 characters (3) 254 characters (4) 1 character

In C a variable cannot contain (1) Blank spaces (2) Hyphen (3) Decimal point (4) All the above

Which of the following is FALSE in C (1) Keywords can be used as variable names (2) Variable names can contain a digit (3) Variable names do not contain a blank space (4) Capital letters can be used in variable names

In C, Arithmetic instruction cannot contain (1) variables (2) constants (3) variable names on right side of = (4) constants on left side of =

Which of the following shows the correct hierarchy of arithmetic operations in C (1) / + * - (2) * - / + (3) + - / * (4) * / + -

What will be the value of d if d is a float after the operation d = 2 / 7.0? (1) 0 (2) (3) Cannot be determined (4) None of the above