# Model Viva Questions for Programming in C lab

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 Model Viva Questions for Programming in C lab Common to: CSE 2 nd sem IT 2 nd sem Title of the Practical: Assignment to prepare general algorithms and flow chart. Q1: What is a flowchart? A1: A flowchart is a diagram that shows a continuous flow of materials or steps to (WIP), work in process. Basically it shows the process, steps or task for something to be completed from beginning to end Q2: What is an Algorithm? A2: An algorithm is an effective method for solving a problem expressed as a finite sequence of steps. Algorithms are used for calculation, data processing, and many other fields. Q3: What is a Brute force algorithm? A3: Brute Force Algorithms: The brute force approach starts at some random point and iterates through every possibility until it finds the solution. Q4: What is Simple Recursive Algorithms A4:Simple Recursive Algorithms: This type of algorithm goes for a direct solution immediately, then backtracks to find a simpler solution. Q5: What is Backtracking Algorithms? A5: Backtracking algorithms test for a solution, if one is found the algorithm has solved, if not it recurs once and tests again, continuing until a solution is found. Q6: What is Divide and Conquer Algorithms: A6: A divide and conquer algorithm is similar to a branch and bound algorithm, except it uses the backtracking method of recurring in tandem with dividing a problem into sub problems. Q7: What are advantages of flow charts? A7: Advantages of flowchart:- 1. It provides an easy way of communication because any other person besides the programmer can understand the way they are represented.2. It represents the data flow.3. It provides a clear overview of the entire program and problem and solution.4. It checks the accuracy in logic flow. Q8: What are different symbols in flowcharts? A8: Q9: What is a connector symbol? A9: Connector Symbol: This symbol is used to connect the various portion of a flow chart. This is normally used when the flow chart is split between two pages. Q10: What is a data flow symbol? A10: Data Flow Symbol :This symbol is used to display the flow of the program. It shows the path of logic flow in a program.

2 Title of the Practical: Assignment to write character, operators symbols of C Language Q1: What are the three primary constants and variable types n C? A1: integer, float,character. Q2: What is the maximum length of variable? A2: 31 characters. Q3: Can a C keyword used as a variable name? A3: No. A4: What does an expression contains? A4: An expression may contains any sequence of constants variable and operators. Q5:How is an expression evaluated? A5: An expression is evaluated based on the hierarchy and operator precedence. Q6: What does the modulus performs? A6: Modulus operator performs division and gives the remainder. Q7: Name different logical operators. A7: Logical OR, logical AND, Logical NOT. Q8: What is syntax of conditional operator? A8: expression1? Expression 2: expression 3. Q9: What is an expression? A9: An expression is any valid combination of tokens. Q10: What is a type conversion? A10: The process of converting one predefined type into another is called type conversion.

3 Title of the Practical: Assignment so identify valid and invalid variables, constants and expressions Q1: What is a variable? A1: Variable represents a named memory location whose values can be manipulated during program run. Q2: How a variable is declared? A2: type name: Q3: What is a constant? A3: A constant is a data item whose data value can never change during the program run. Q4: List some valid logical expression. A4: x>y, (y=z)>=(x/z), x y&&z. Q5: What is a keyword? A5: Keyword is a word carrying special meaning and purpose. Q6: What are Literals? A6: Literals are data items that never change their values during a program run. Q7: What are two categories of C constants? A7: (a) Primary constants (b) Secondary constant Q8: What is the range of integer constant? A8: The range of integer costant depends upon the compiler. Q9: What is the range of integer constant for compilers like Turbo C? A9: Range: to Q10: What is the maximum length of character constants? A10: The maximum range of character constant can be 1 character.

4 Title of the Practical: Program based on Input/Output statements. Q1: What is the output of printf("%d")? A1: When we write printf("%d",x); this means compiler will print the value of x. But as here, there is nothing after %d so compiler will show in output window garbage value. Q2: What is the difference between printf() and sprintf()? A2 : sprintf() writes data to the character array whereas printf(...) writes data to the standard output device. Q3: What three primary constants and variable type in c? A3: integer float and character. Q4: What is a variable? A4: A variable is a named storage location. It has two associated values : rvalue that gives its contents and lvalue that gives its address. Q5: What is the maximum length of a variable name? A5: A variable name can be maximum 31 characters. Q6: How input and output in c can be achieved?? A6: Using scanf() and printf(). Q7: What is the function of prefix version of increment and decrement? A7: The prefix first changes (increments or decrements) its operand s value and then uses it i.e., it follows change-thenuse rule. Q8: How operators with equal precedence are evaluated? A8: Using associativity. Q9: What type of expression is arithmetic expression? A9: Arithmetc expression can either be integer expression or real expressions or mixed mode expressions. Q10: What we do in implicit conversion? A10: In implicit conversion, all operands are converted upto the type of the largest operand, which is called type promotion.

5 Title of the Practical: Program based on Arithmetic expression Q1: What type of expression is arithmetic expression? A1: Arithmetc expression can either be integer expression or real expressions or mixed mode expressions. Q2: Name the four basic data types in C language? A2: The four basic data types in c language are as follows (i) Char (ii) Int (iii) Float (iv) Double Q3: Describe at least five different format specifiers? A3: %d: -An integer whole number %f: -a floating point number %c: -a single character %p: -a machine memory address Q4: Define and explain scanf () function? A4: The Scanf () function can be used to get input into a program and it requires two arguments. First a format specifier defines the type of data to be entered, then the name of the variable in which the input will be stored. This scanf () function is responsible for giving input into the program. Q5: What are the maximum and minimum possible ranges of values for long and short type? A5: If the int variable is created by default as a long type it typically will have a possible range of values from a maximum of and a minimum of For short type these are the maximum and minimum values and minimum (While answering this question you can specify the approximate value raised to power). Q6: What exactly is a variable scope, local variables and global variables? A6: The extent to which a variable is accessible in a program is called the variable scope. Variables declared internally inside a function are known as local variables. Variables declared externally outside a function are known as global variables. Q7:What are signed values? A7: When an int variable is declared it can by default contain either positive of negative integer values. These are known as signed values. The range of positive values is determined by your system. Q8: Explain about register variables relative to compiler? A8: A register variable declaration informs the compiler that the specified variable will be heavily used by the program. The intention is for the compiler to place register variables in the machine register of the computer to speed access times. Local internal variables can only be declared as register variables. Q9: State some significant uses of arrays in C programming? A9: One of the most significant uses of arrays in c programming concerns with their ability to store strings of text. Each element in an array of the char data type can store a single character. Adding the special null character escape sequence in the arrays final element promotes the array to string. It can be referenced using the array name and can be displayed using the %s format specifier. Q10: What is enum used for and state its format? A10: The enum keyword provides a handy way to create a sequence of integer constants in a concise manner. Optionally the declaration can include a name for the sequence after the enum keyword. The constant names follow with a comma and placed within braces. The name assigned can be used to call the function again at later stage. The constants can be assigned any individual value but the following constant will always increment it by one.

7 Title of the Practical: A Program based on go to statement Q1: What is a goto statement? A1: The goto statement is a jump statement which jumps from one point to another point within a function. Q2: What is the difference between goto and longjmp() and setjmp()? A2: A goto statement implements a local jump of program execution, and the longjmp() and setjmp() functions implement a nonlocal, or far, jump of program execution. Q3: What is the problem with goto statement? A3: The big problem with goto statement is that when we do use them we can never sure how we got to a certain point in our code. Q4:Why the use of goto keyword must be avoided? A4: Because it usually violets the flow of execution. Q5: Define structural language and procedural language? A5: Structural language is one which can have a specific structure.c is a structured language before structural language procedural language was used. Q6:What is Preprocessor? A6:preprocessor is a program which is invoked before the compilation process. it access input data and process output data which has been used as input data to the other program like compiler. Q7: What is modular programming? A7: A large program can be divided into small Modules or into small programs or functions To solve a particular problem all the Modules are combined together. This is called Modular Programming. Q8: What is the code for clrscr() function? A8:clrscr() is a function which creates a screenful of black dots which seems us to be clearing the screen or making a new screen. Q9:What is the purpose of main( ) function? A9: main() is the user defined function. the program execution is always started from main. it is not possible to write the program without main(). Q10: What is the function of break statement when used within switch? A10: The break statement when used in aswitch takes the control outside the switch.

8 Title of the Practical: Two Programs based on `if' and `Nested if. Q1: What is the purpose of if statement? A1: The keyword if tells the compiler that what follows is a decision control instruction. Q2:How does if statement works? A2: If the condition within the paranthesis is true then the statement is executed otherwise not. Q3: How does we express a condition itself in C? A3: We express a condition using C s relational operators. Q4: What is equality operator? A4:== is used to compare the equality of two statements. Q5: What is the syntax of if statement? A5: if(expression) Statement; Q6: What are the different ways of decision making in a program? A6: There are the ways:- if- else, conditional operators, switch statement. Q7: What is the default scope of if statement? A7: Next statement. Q8: What are && and? A8: These two are binary operators. Q9: What is important in if else block? A9: An if block need not be always associated with an else block. However an else block must be associated with an if block. Q10: Name a unary operator. A10:! (not equal to) is a unary operator.

9 Title of the Practical: Program based on switch case statement. Q1: What is a switch? A1: The control statement that allows us to make a decision from the number of choices is called a switch. Q2: What is case keyword? A2: The case keyword is followed by an integer or a character constant. Q3: What happens when we run a program containing a switch? A3: First, the integer expression following the keyword switch is evaluated.i Q4: Is there any problem with the following : char*a=null; char& p = *a;? A4: The result is undefined. You should never do this. A reference must always refer to some object. Q5: Is switch a replacement of if? Yes and No. A5: Yes, because it offers a better way of writing program as compared to if, and no, because in certain cases we are left with no choices. Q6: What is the difference between const char *mypointer and char *const mypointer? A6: Const char *mypointer is a non constant pointer to constant data; while char *const mypointer is a constant pointer to non constant data. Q7: From which is the pointer to object of a base class type compatible? A7: Pointers to object of a base class type is compatible with pointer to onject of a derived class. Therefore, we can use single pointer variable to point to objects of base class as well as derived class. Q8: What is a this pointer? A8: A special pointer known as this pointer stores the address of the object that is currently invoking a member function. Q9:Where is switch statement is useful? A9: Switch statement is useful while writing menu driven programs.. Q10: Why is Arrow operator ( -> ) used? A10: The arrow operator is used to access the public members of the class with a pointer to an object.

10 Title of the Practical:. At least one program based on each (a) For statement, (b) While statement,(c) Do-while statement, (d) Break statement Q1. What is the difference between declaring a variable and defining a variable? A1: Declaration of a variable in C hints the compiler about the type and size of the variable in compile time. Similarly, declaration of a function hints about type and size of function parameters. No space is reserved in memory for any variable in case of declaration. Q2. What is a static variable? A2: A static variable is a special variable that is stored in the data segment unlike the default automatic variable that is stored in stack. A static variable can be initialized by using keyword static before variable name. Example: static int a = 5; Q3. What is a register variable? A3: Register variables are stored in the CPU registers. Its default value is a garbage value. Scope of a register variable is local to the block in which it is defined. Lifetime is till control remains within the block in which the register variable is defined. Q4. Where is an auto variable stored? A4: Main memory and CPU registers are the two memory locations where auto variables are stored. Auto variables are defined under automatic storage class. They are stored in main memory. Memory is allocated to an automatic variable when the block which contains it is called and it is de-allocated at the completion of its block execution. Auto variables:storage : main memory. Default value : garbage value.scope : local to the block in which the variable is defined.lifetime : till the control remains within the block in which the variable is defined. Q5. What is scope & storage allocation of extern and global variables? A5: Extern variables: belong to the External storage class and are stored in the main memory. extern is used when we have to refer a function or variable that is implemented in other file in the same project. The scope of the extern variables is Global.Global variables: are variables which are declared above the main( ) function. These variables are accessiblethroughout the program. They can be accessed by all the functions in the program. Their default value is zero. Q6. What is scope & storage allocation of static and local variables? A6. Static variables: Memory is allocated at the beginning of the program execution and it is reallocated only after the program terminates. The scope of the static variables is local to the block in which the variables are defined. Local variables: are variables which are declared within any function or a block. They can be accessed only by function or block in which they are declared. Their default value is a garbage value. Q7. What are storage memory, default value, scope and life of Automatic and Register storage class? A7. 1. Automatic storage class:storage : main memory.default value : garbage value.scope : local to the block in which the variable is defined.lifetime : till control remains within the block. 2. Register storage class:storage : CPU registers.default value : garbage value.scope : local to the block in which the variable is defined.lifetime : till control remains within the block. Q8. What are storage memory, default value, scope and life of Static and External storage class? A8. Static storage class:storage : main memory.default value : zeroscope : local to the block in which the variable is defined.lifetime : till the value of the variable persists between different function calls. 2. External storage class:storage : main memorydefault value : zeroscope : globallifetime : as long as the program execution doesn't come to an end. Q9. What is the difference between 'break' and 'continue' statements? A9. 1. break is a keyword used to terminate the loop or exit from the block. The control jumps to next statement after the loop or block. And continue is a keyword used for skipping the current iteration and go to next iteration of the loop 10. What is the difference between 'for' and 'while' loops? A10. for loop: When it is desired to do initialization, condition check and increment/decrement in a single statement of an iterative loop, it is recommended to use 'for' loop.\syntax: for(initialization;condition;increment/decrement) while loop: When it is not necessary to do initialization, condition check and increment/decrement in a single statement of an iterative loop, while loop could be used. In while loop statement, only condition statement is present.

11 Title of the Practical: Program based on one dimensional array and two dimensional arrays Q1: What are arrays? A1:An array is similar to an ordinary variable except that it can store multiple elements of similar type. Q2: Does compiler perform bound checking on an arrays? A2: No, It doesnot perform bound checking on arrays. Q3: How are array elements stored? A3: Array elements are stored in contiguous locations and so they can be accessed using pointers. Q4: What type of arithmetic can be done on pointer? A4: Only limited arithmetic can be done on pointers. Q5: How is individual element in an array can be accessed? A5: Individual element in an array can be accessed by using subscript, the number in the bracket following the array name. Q6: How can we enter data on arrays? A6: Data in an array element can be inserted by using loops. Q7: What happens if the size of array exceeds?. A7: Data entered with subscript exceeding the array size will simply be placed in memory outside the array. Q8: How are array elements can be passed to function? A8: By calling the function by value or by reference. Q9: What is important is initilizating 2-d arrays? A9: It is necessary to mention the second (coulum) dimension,whereas the first dimension(row) is optional. Q10: What is the syntax of array declaration? A10: data_type array _name[ size of array};

12 Title of the Practical: Programs based on string operations Q1:What are strings? A1: Character arrays are many atime called strings. Q2: What is a string constant? A2: A string constant is a one dimensional array of characters terminated by a null ( \0 ). Q3: Why is null character important? A3: It is the only way the function that work with a string can know where the string ends. Q4: How is null character inserted? A4: C inserts null character automatically. Q5:Explain the purpose of strlen(). A5: This function counts the number of characters present in a string. Q6: What is strcat()? A6: Appends one string at the end of another. Q7: What is strcpy? A7: Copies a string into another. Q8: What is the use of strcmp? A8: Compares two string. Q9: How strcmp() works? A9: It would return 0 if two string matches otherwise return a non-zero value. Q10: Which functions can handle multi-word strings. A10: printf() and puts().

14

### SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR ODD/EVEN ACADEMICSEMESTER (2014-15) ASSIGNMENT / QUESTION BANK (2110003) [F.Y.B.E.

SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR ODD/EVEN ACADEMICSEMESTER (2014-15) ASSIGNMENT / QUESTION BANK Subject: Computer Programming and Utilization (2110003) [F.Y.B.E.: ALL BRANCHES] Unit 1

### The C Programming Language course syllabus associate level

TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming

### MIT Aurangabad FE Computer Engineering

MIT Aurangabad FE Computer Engineering Unit 1: Introduction to C 1. The symbol # is called a. Header file c. include b. Preprocessor d. semicolon 2. The size of integer number is limited to a. -32768 to

### UNIT-1. C Programming & Data Structures. Introduction to Computers: Computing Environment: Types of Computing Environments:

Introduction to Computers: C Programming & Data Structures UNIT-1 A computer system consists of hardware and software. Computer hardware is the collection of physical elements that comprise a computer

### KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

KITES TECHNOLOGY 360 Degree Solution www.kitestechnology.com/academy.php info@kitestechnology.com technologykites@gmail.com Contact: - 8961334776 9433759247 9830639522.NET JAVA WEB DESIGN PHP SQL, PL/SQL

### Chapter 2: Problem Solving Using C++

Chapter 2: Problem Solving Using C++ 1 Objectives In this chapter, you will learn about: Modular programs Programming style Data types Arithmetic operations Variables and declaration statements Common

### Informatica e Sistemi in Tempo Reale

Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)

### INTRODUCTION TO FLOWCHARTING

CHAPTER 1 INTRODUCTION TO FLOWCHARTING 1.0 Objectives 1.1 Introduction 1.2 Flowcharts 1.3 Types of Flowcharts 1.3.1 Types of flowchart 1.3.2 System flowcharts 1.4 Flowchart Symbols 1.5 Advantages of Flowcharts

### C Programming Dr. Hasan Demirel

C How to Program, H. M. Deitel and P. J. Deitel, Prentice Hall, 5 th edition (3 rd edition or above is also OK). Introduction to C Programming Dr. Hasan Demirel Programming Languages There are three types

### 3) Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?

Freshers Club Important 100 C Interview Questions & Answers 1) How do you construct an increment statement or decrement statement in C? There are actually two ways you can do this. One is to use the increment

### Punctuation in C. Identifiers and Expressions. Identifiers. Variables. Keywords. Identifier Examples

Identifiers and Expressions CSE 130: Introduction to C Programming Spring 2005 Punctuation in C Statements are terminated with a ; Groups of statements are enclosed by curly braces: { and } Commas separate

### 7 Introduction to C++

7 Introduction to C++ 7.1 Introduction C++ is an extension to C Programming language. It was developed at AT&T Bell Laboratories in the early 1980s by Bjarne Stroustrup. It is a deviation from traditional

### Which of the following is the correct operator to compare two variables? A. := B. = C. equal D. ==

Group 1 Question 1. What is the correct value to return to the operating system upon the successful completion of a program? A. -1 B. 1 C. 0 D. Programs do not return a value. Question 2. What is the only

### GTU Questions. Computer Programming & Utilization. Chief Course Coordinator Prof. Mitul K.Patel. (Head of Department & Assistant Professor)

GTU Questions Computer Programming & Utilization Chief Course Coordinator Prof. Mitul K.Patel (Head of Department & Assistant Professor) Course Coordinator Prof. Vrutti D. Shah (Assistant Professor) Lab

### Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection

### INDEX. C programming Page 1 of 10. 5) Function. 1) Introduction to C Programming

INDEX 1) Introduction to C Programming a. What is C? b. Getting started with C 2) Data Types, Variables, Constants a. Constants, Variables and Keywords b. Types of Variables c. C Keyword d. Types of C

### Sources: On the Web: Slides will be available on:

C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,

### 6.087 Lecture 3 January 13, 2010

6.087 Lecture 3 January 13, 2010 Review Blocks and Compound Statements Control Flow Conditional Statements Loops Functions Modular Programming Variable Scope Static Variables Register Variables 1 Review:

### BHARATHIAR UNIVERSITY: COIMBATORE CENTRE FOR COLLABORATION OF INDUSTRY AND INSTITUTIONS(CCII) CERTIFICATE IN ADVANCED PROGRAMMING C++ LANGUAGE

Certificate in Advanced Programming - C++ Language Page 1 of 7 BHARATHIAR UNIVERSITY: COIMBATORE 641046 CENTRE FOR COLLABORATION OF INDUSTRY AND INSTITUTIONS(CCII) CERTIFICATE IN ADVANCED PROGRAMMING C++

### 6.096 Lab 1. Due: 7 January 12:30:00. September 20, 2011

6.096 Lab 1 Due: 7 January 1:30:00 September 0, 011 1 Additional Material 1.1 Constants A constant is an expressions with a fixed value. Kinds of constants: Literals: used to express particular values

### C AND C++ PROGRAMMING

C AND C++ PROGRAMMING Bharathidasan University A Courseware prepared by University Informatics Centre Part I - Programming in C Getting Started This courseware is intended to be an introduction to C programming

### Programming for MSc Part I

Herbert Martin Dietze University of Buckingham herbert@the-little-red-haired-girl.org July 24, 2001 Abstract The course introduces the C programming language and fundamental software development techniques.

### Basic C Syntax. Comp-206 : Introduction to Software Systems Lecture 10. Alexandre Denault Computer Science McGill University Fall 2006

Basic C Syntax Comp-206 : Introduction to Software Systems Lecture 10 Alexandre Denault Computer Science McGill University Fall 2006 Next Week I'm away for the week. I'll still check my mails though. No

### 1. Constants. 2. Variables. 3. Reserved words or key words. 4. Constants. Character set in C

Character set in C We should use only the following characters in writing a C program. These characters can be combined to create C words. Alphabet: A, B, C, D.. Z, a, b, c, d..z Numeric digits: 0, 1,

### Lecture 03 Bits, Bytes and Data Types

Lecture 03 Bits, Bytes and Data Types In this lecture Computer Languages Assembly Language The compiler Operating system Data and program instructions Bits, Bytes and Data Types ASCII table Data Types

### C++ INTERVIEW QUESTIONS

C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get

### Common Errors in C. David Chisnall. February 15, 2011

Common Errors in C David Chisnall February 15, 2011 The C Preprocessor Runs before parsing Allows some metaprogramming Preprocessor Macros Are Not Functions The preprocessor performs token substitution

### C++ Programming: From Problem Analysis to Program Design, Fifth Edition. Chapter 2: Basic Elements of C++

C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 2: Basic Elements of C++ Objectives In this chapter, you will: Become familiar with the basic components of a C++ program,

### Adjusted/Modified by Nicole Tobias. Chapter 2: Basic Elements of C++

Adjusted/Modified by Nicole Tobias Chapter 2: Basic Elements of C++ Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types

### CSI 333 Lecture 2 Introduction to C: Part I 2 1 / 16

CSI 333 Lecture 2 Introduction to C: Part I 2 1 / 16 Basics of C Remark: Skim Chapters 1 through 6 of Deitel & Deitel. You will notice the following: C is (more or less) a subset of Java. (So, you are

### C Programming 1. C Programming

C Programming 1 1 C Programming 1. Who developed the C language? Dennis M.Ritchie in 1972 2. What type of language is C? Semi-high level language 3. What is main()? The main() is a special function used

### PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?

1. Distinguish & and && operators. PART-A Questions 2. How does an enumerated statement differ from a typedef statement? 3. What are the various members of a class? 4. Who can access the protected members

### z = x + y * z / 4 % 2-1

1.Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1? A. rem = 3.14 % 2.1; B. rem = modf(3.14, 2.1); C. rem = fmod(3.14, 2.1); D. Remainder cannot be obtain

### Keywords are identifiers having predefined meanings in C programming language. The list of keywords used in standard C are : unsigned void

1. Explain C tokens Tokens are basic building blocks of a C program. A token is the smallest element of a C program that is meaningful to the compiler. The C compiler recognizes the following kinds of

### GETTING STARTED WITH C++ C++ BASICS - 1 -

- 1 - GETTING STARTED WITH C++ Programming is a core activity in the process of performing tasks or solving problems with the aid of a computer. An idealised picture is: PROBLEM COMPUTER SOLUTION Unfortunately

### C A short introduction

About these lectures C A short introduction Stefan Johansson Department of Computing Science Umeå University Objectives Give a short introduction to C and the C programming environment in Linux/Unix Go

### Programming Language: Syntax. Introduction to C Language Overview, variables, Operators, Statements

Programming Language: Syntax Introduction to C Language Overview, variables, Operators, Statements Based on slides McGraw-Hill Additional material 2004/2005 Lewis/Martin Modified by Diana Palsetia Syntax

### VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANKULATHUR 603 203 DEPARTMENT OF COMPUTER APPLICATIONS QUESTION BANK IN REVISED BLOOM S TAXONOMY

ACADEMIC YEAR: 0 7 VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANKULATHUR 0 0 SEMESTER: ODD BRANCH: MCA YEAR: I SEMESTER: I SUBJECT CODE AND NAME: MC70 Problem Solving and Programming NAME OF THE FACULTY

### UNIT-1 PART-A UNIT-2 PART-A

UNIT-1 1. Define computer? 2. Discuss briefly about input and output devices? 3. What is a RAM? 4. What is arom? 5. What is a compiler? 6. Write about a linker? 7. List any 5 key wordsof c? 8. Illustrate

### Introduction to C Programming S Y STEMS

Introduction to C Programming CS 40: INTRODUCTION TO U NIX A ND L I NUX O P E R AT ING S Y STEMS Objectives Introduce C programming, including what it is and what it contains, which includes: Command line

### Going from Python to C

Going from Python to C Darin Brezeale December 8, 2011 Python is a high-level, interpreted language. C has many of the same types of programming constructs as in Python: arrays, loops, conditionals, functions,

### 1) String initialization can be carried out in the following ways, similar to that of an array :

Strings in C : Overview : String data type is not supported in C Programming. String is essentially a collection of characters to form particular word. String is useful whenever we accept name of the person,

### MGM s JNEC Question Bank Subject: Computer Engineering

MGM s JNEC Question Bank Subject: Computer Engineering 1. All of the following are examples of computer input units EXCEPT: a) Scanner b) Speaker c) Bar code reader d) Keyboard Answer: b 2. Which of the

### C Strings. Handout #06 January 23, CS106L Winter Introduction

CS106L Winter 2007-2008 Handout #06 January 23, 2008 C Strings Introduction C strings are very difficult to work with. Very difficult. In fact, they are so difficult to work with that C++ programmers invented

### Introduction to C Programming

Introduction to C Programming C HOW TO PROGRAM, 6/E 1992-2010 by Pearson Education, Inc. All Rights Reserved. 2.1 Introduction The C language facilitates a structured and disciplined approach to computer

### Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to

### MPI and C-Language Seminars 2010

MPI and C-Language Seminars 2010 Seminar Plan (1/3) Aim: Introduce the C Programming Language. Plan to cover: Basic C, and programming techniques needed for HPC coursework. C-bindings for the Message Passing

### Arrays and Pointers (part 1)

Arrays and Pointers (part 1) EECS 2031 25 September 2016 1 Arrays l Grouping of data of the same type. l Loops commonly used for manipulation. l Programmers set array sizes explicitly. 2 1 Arrays: Example

### CS201- Introduction to Programming Latest Solved Mcqs from Final term Papers July 11,2011

CS201- Introduction to Programming Latest Solved Mcqs from Final term Papers July 11,2011 Mc100401285 moaaz.pk@gmail.com Moaaz Siddiq Bc100400662 bc100400662asad@gmail.com Asad Ali Latest Mcqs FINALTERM

### Common C Errors. Compiled by: Leela Kamalesh Yadlapalli

Common C Errors Compiled by: Leela Kamalesh Yadlapalli This document shows some of the common errors and warnings that you may encounter during this class. Always remember to use the Wall option if you

### Characters and Strings. Constants

Characters and Strings Constants Characters are the fundamental building blocks of source programs Character constants One character surrounded by single quotes A or? Actually an int value represented

### 6.087 Lecture 5 January 15, 2010

6.087 Lecture 5 January 15, 2010 Review Pointers and Memory Addresses Physical and Virtual Memory Addressing and Indirection Functions with Multiple Outputs Arrays and Pointer Arithmetic Strings String

### AFF 826. Sub. Code 4BSO1C1. Sp2. B.Sc. DEGREE EXAMINATION, NOVEMBER First Semester. Software FUNDAMENTALS OF COMPUTERS AND C PROGRAMMING

Sp2 AFF 826 Sub. Code 4BSO1C1 B.Sc. DEGREE EXAMINATION, NOVEMBER 2015 First Semester Software FUNDAMENTALS OF COMPUTERS AND C PROGRAMMING (CBCS 2014 onwards) Time : 3 Hours Maximum : 75 Marks Part A (10

### Chapter One Introduction to Programming

Chapter One Introduction to Programming 1-1 Algorithm and Flowchart Algorithm is a step-by-step procedure for calculation. More precisely, algorithm is an effective method expressed as a finite list of

### Chapter 8. Arithmetic in C++

Christian Jacob Chapter 8 Arithmetic in C++ 8.1 The C++ Vocabulary 8.2 Variables and Types 8.2.1 Data Objects 8.2.2 Variables 8.2.3 Declaration of Variables 8.3 Elementary C++ Data Types 8.3.1 Integers

### Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups:

JAVA OPERATORS GENERAL Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups: Arithmetic Operators Relational Operators Bitwise Operators

### PROGRAMMING IN C PROGRAMMING IN C CONTENT AT A GLANCE

PROGRAMMING IN C CONTENT AT A GLANCE 1 MODULE 1 Unit 1 : Basics of Programming Unit 2 : Fundamentals Unit 3 : C Operators MODULE 2 unit 1 : Input Output Statements unit 2 : Control Structures unit 3 :

### Java Review (Essentials of Java for Hadoop)

Java Review (Essentials of Java for Hadoop) Have You Joined Our LinkedIn Group? What is Java? Java JRE - Java is not just a programming language but it is a complete platform for object oriented programming.

### C Primer. Fall Introduction C vs. Java... 1

CS 33 Intro Computer Systems Doeppner C Primer Fall 2016 Contents 1 Introduction 1 1.1 C vs. Java.......................................... 1 2 Functions 1 2.1 The main() Function....................................

### Indicates the end of data when the number of data is not known in advance Must be distinct from the data but be of the same type

Program Control Essentials of repetition Loop control variable Counts the number of repetitions in the counter-controlled loop Controls the execution of loop Sentinel value Indicates the end of data when

### Model Paper Computer Science Objective. Paper Code Time Allowed: 20 minutes

Note: This is Model Paper for guidance of students & teachers. Q. Model Paper Computer Science Objective Intermediate Part II ( th Class) Examination Session -4 and onward Total marks: 7 Paper Code Time

### C Interview Questions

http://techpreparation.com C Interview Questions And Answers 2008 V i s i t T e c h P r e p a r a t i o n. c o m f o r m o r e i n t e r v i e w q u e s t i o n s a n d a n s w e r s C Interview Questions

### Lecture 3 C Programming Language

Lecture 3 C Programming Language Summary of Lecture 3 streams error handling library functions break, continue, switch statements constants and macros C preprocessor (CPP) header files Streams Stdin, stdout

### switch Multiple-Selection Statement

switch Multiple-Selection Statement (This feature is rarely useful, although it s perfect for programming the iterative song The Twelve Days of Christmas!) If no match occurs, the default case is executed,

### Glossary of Object Oriented Terms

Appendix E Glossary of Object Oriented Terms abstract class: A class primarily intended to define an instance, but can not be instantiated without additional methods. abstract data type: An abstraction

### Java Interview Questions and Answers

1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write and compile the java

### Variables and constants linked with operators. Uses relational and logical operators Evaluates to 1 or 0 (true or false) only

Expressions 1 Expressions Variables and constants linked with operators Arithmetic expressions Uses arithmetic operators Can evaluate to any value Logical expressions Uses relational and logical operators

### Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas

CS 110B - Rule Storage Classes Page 18-1 Attributes are distinctive features of a variable. Data type, int or double for example, is an attribute. Storage class is another attribute. There are four storage

### PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON

PROBLEM SOLVING WITH SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON Addison Wesley Boston San Francisco New York London

### an array of 10 characters would require 10 bytes of storage for data. On the other hand, would require 10*sizeof(int) amount of storage.

Lecture 05 C Arrays & pointers In this lecture Introduction to 1D arrays Array representation, access and updates Passing arrays to functions Array as a const pointer Dynamic arrays and resizing Introduction

### Object Oriented Software Design

Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 28, 2010 G. Lipari (Scuola Superiore Sant Anna) Introduction

### SFC A Structured Flow Chart Editor Version 2.3 User s Guide Tia Watts, Ph.D. Sonoma State University

SFC A Structured Flow Chart Editor Version 2.3 User s Guide Tia Watts, Ph.D. Sonoma State University 1 of 35 SFC A Structured Flow Chart Editor Version 2.3 User s Guide Table of Contents 1. Introduction...

### Chapter 2: Basic Elements of C++

Chapter 2: Basic Elements of C++ Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates

### COMP 356 Programming Language Structures Notes for Chapter 5 of Concepts of Programming Languages Names, Types and Scopes

Some definitions: COMP 356 Programming Language Structures Notes for Chapter 5 of Concepts of Programming Languages Names, Types and Scopes a name is a string of characters (a word) that represents a program

### 9 Control Statements. 9.1 Introduction. 9.2 Objectives. 9.3 Statements

9 Control Statements 9.1 Introduction The normal flow of execution in a high level language is sequential, i.e., each statement is executed in the order of its appearance in the program. However, depending

### PE1 Worksheet. 3) What are the three control structures for writing an algorithm in pseudocode?

PE1 Worksheet Problem solving 1) What are the four stages of problem solving by programming? What shall be done in each stage? Stage 1: Stage 2: Stage 3: Stage 4: 2) What is the top-down design strategy

### WEB MANAGEMENT CT211. Fall 2012 PACKET II

Fall 2012 CT211 WEB MANAGEMENT PACKET II This packet includes the mandatory assignments for each Chapter that is covered in the required course textbooks. All assignments must be completed on the date

### Dept. of CSE, IIT KGP

Programming in C: Basics CS10001: Programming & Data Structures Pallab Dasgupta Professor, Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Types of variable We must declare the

### A First Book of C++ Chapter 2 Data Types, Declarations, and Displays

A First Book of C++ Chapter 2 Data Types, Declarations, and Displays Objectives In this chapter, you will learn about: Data Types Arithmetic Operators Variables and Declarations Common Programming Errors

### I PUC - Computer Science. Practical s Syllabus. Contents

I PUC - Computer Science Practical s Syllabus Contents Topics 1 Overview Of a Computer 1.1 Introduction 1.2 Functional Components of a computer (Working of each unit) 1.3 Evolution Of Computers 1.4 Generations

### Assembly language programs are made up of statements. Each statement may be composed of constants, literals, names, mnemonics, operands, and comments.

CS221 Assembly Language Fundamentals : Irvine Chapter 3 While debug is good for writing very small programs and experimenting with memory, interrupts, and function calls, it is not very good for larger

### Fundamentals of Computer & Programming in C Short-answer type questions

Fundamentals of Computer & Programming in C Short-answer type questions Section- A i. What is a computer system? Draw the block diagram of computer. ii. Differentiate between Real Time Operating System

### Data Structure with C

Subject: Data Structure with C Topic: Strings In this chapter we are emphasizing the reading and storing string and also manipulation concepts through the following millstones. The discussion starts with

### 5 Arrays and Pointers

5 Arrays and Pointers 5.1 One-dimensional arrays Arrays offer a convenient way to store and access blocks of data. Think of arrays as a sequential list that offers indexed access. For example, a list of

### Object Oriented Software Design

Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa September 14, 2011 G. Lipari (Scuola Superiore Sant Anna) Introduction

### C PROGRAMMING FOR MATHEMATICAL COMPUTING

UNIVERSITY OF CALICUT SCHOOL OF DISTANCE EDUCATION BSc MATHEMATICS (2011 Admission Onwards) VI Semester Elective Course C PROGRAMMING FOR MATHEMATICAL COMPUTING QUESTION BANK Multiple Choice Questions

### A Rudimentary Intro to C programming

A Rudimentary Intro to C programming Wayne Goddard School of Computing, Clemson University, 2008 Part 4: Strings and Pointers 18 Strings.................................... D1 19 String Functions..............................

### File Handling. CS10001: Programming & Data Structures

File Handling CS10001: Programming & Data Structures Pallab Dasgupta Professor, Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur 1 What is a file? A named collection of data, stored

### Borland C++ Compiler: Hello World Program

Introduction Borland C++ Compiler: Hello World Program This article explains how to display text in a console program using the Borland C++ Compiler. The hello program writes Hello World to the console.

### M3-R4: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE

M3-R4: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE NOTE: IMPORTANT INSTRUCTIONS: 1. Question Paper in English and Hindi and Candidate can choose any one language. 2. In case of discrepancies in

### C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands

C Programming for Embedded Microcontrollers Warwick A. Smith Elektor International Media BV Postbus 11 6114ZG Susteren The Netherlands 3 the Table of Contents Introduction 11 Target Audience 11 What is

### strsep exercises Introduction C strings Arrays of char

strsep exercises Introduction The standard library function strsep enables a C programmer to parse or decompose a string into substrings, each terminated by a specified character. The goals of this document

### Overview of a C Program

Overview of a C Program Programming with C CSCI 112, Spring 2015 Patrick Donnelly Montana State University Programming with C (CSCI 112) Spring 2015 2 / 42 C Language Components Preprocessor Directives

### Strings in C++ and Java. Questions:

Strings in C++ and Java Questions: 1 1. What kind of access control is achieved by the access control modifier protected? 2 2. There is a slight difference between how protected works in C++ and how it

### TN203. Porting a Program to Dynamic C. Introduction

TN203 Porting a Program to Dynamic C Introduction Dynamic C has a number of improvements and differences compared to many other C compiler systems. This application note gives instructions and suggestions

### 14 MAKING DECISIONS IN C

14 MAKING DECISIONS IN C 14.1 INTRODUCTION So far we have seen that in C programs the instructions are executed in the same order in which they appear in the program. Each instruction is executed once

### Figure 1.12 Entering, Translating, and Running a High-Level Language Program Pearson Education, Inc. All rights reserved.

Figure 1.12 Entering, Translating, and Running a High-Level Language Program 1 2007 Pearson Education, Inc. All rights reserved. 2 Figure 2.7 General Form of a C Program 2007 Pearson Education, Inc. All