C Programming Laboratory

Size: px
Start display at page:

Download "C Programming Laboratory"

Transcription

1 Sheet 1 of 14 LAB 1: Introduction to C Environment Objective: In this laboratory session you will learn: 1. How to create C programs 2. How C programs are organised 3. How to write a basic program to display text on the screen The C Environment: What is C? C is a `programming language'. That is, it is a language that allows you to specify exactly what you want your computer to do and explain clearly for other people what you are doing. C is a high level multi-purpose programming language that can be run across a number of different platforms. For example, it can run on: MS DOS WINDOWS UNIX A high level programming language uses keywords and symbols that humans are familiar with. High level programming languages were developed to make it easier for humans to program computers. Remember all the information inside a computer is in binary form, including the program instructions. It would be tedious for humans to enter this so-called low-level code, so different high level programming languages were developed, for example PASCAL and C. A high level language can not run directly on your computer, it must be compiled (converted) into a set of simple instructions that a computer can use. Each instruction is used to instruct the computer to perform a specific operation. C programming environment: C is a programming language of many different dialects because there are so many compilers. Each compiler is a little different. The library functions of one will have all of ANSI C, the standard, but will also contain additional functions. The version used on this course is Borland C version 2. To start it type tc2 at the F: prompt. This will take you into the C programming environment, which contains the following functions. AN EDITOR: this is a basic text editor, which allows the user to write C code any text editor can be used. The C program is called to C source code and is saved as a source file (*.c). A COMPILER: C is a high level language and in order for it to run on a PC, a C program must be broken down in to a set of machine code instructions which can be processed. This is the first part of the process of making an executable program. It takes in a source file (*.c) and it produces object code which is stored in an object file (*.obj). A LINK EDITOR: As part of writing a program, code that has been written by other developers can be inserted into a program that is being developed. A simple example of this is the stdio.h file which contains input and output functions like printf() and scanf(), that are used to print text to the computer monitor or received input typed from the keyboard. The output of the link editor is an executable file (*.exe). A DEBUGGER: This is used to debug problems in the code that has been written.

2 Sheet 2 of 14 Edit: create/modify source code Compile: generates machine instructions yes Error? No Link: Link library files yes Error? No Execute: Run the program source file (myprog.c) object file (myprog.obj) executable file (myprog.exe) yes Error? No Success! The C Environment Structure of a C Program A C program would typically consist of the following sections: 1. The Pre-Processor Directives 2. Programmer s Block descriptive comments by the programmers 3. Main Function containing various types of C statements 4. Other Functions Example: Hello World Program: C Program Code /**************************************/ /* Sample Program */ /**************************************/ /* Developed by: A Programmer */ /* Date: Nov. 1, 1999 */ /**************************************/ /* This program prints the text */ /* HELLO WORLD on the PC monitor */ /**************************************/ main() printf( HELLO WORLD \n ); /* C statements end with ; */ /* printf is a function in */ /* stdio.h that allows data */ /* to be printed on the */ /* screen (stdout) */ /* end of function main */ Description 1. Pre-Processor Directives - used to tell the compiler of header files that have to be included, and to declare constants and global variables. These will be covered later 2. Programmer s Block /* and */ are used to enclose pieces of text which describe what the program does. This text is called a comment 3. main() is the start of the function main. The body of the function is enclosed between the curly brackets. 4. printf() is a function used to display a string of text on the screen

3 Sheet 3 of 14 What did it all mean? In C, programs are organised into blocks, called `functions'. A C function is similar to a mathematical function: it typically takes arguments; it performs an operation on these, and typically returns a result. For example, the addition of two numbers, a computer takes two numbers and performs the addition operation on them and then returns the result of the operation. In C, the function called `main' is where the program execution starts. In the case of a very simple program, the lines which make a `main function' look like: main() However, this function doesn't do anything until instructions are put inside the squiggly brackets. In the example program above, there is one instruction inside: printf( HELLO WORLD \n ); This is in fact an invocation of another function, `printf'. The `printf' function is provided with the compiler or operating system. In this example, it takes a single operand, which is a `quoted string' ( HELLO WORLD \n ) and displays this on the PC monitor. Now look at the first line of code: The # indicates that this is a pre-processor directive, which is an instruction to the comipler to do something before compiling the source code. If the main function is to call another function, in this case `printf', the preprocessor directive should instruct the compiler to include in the program the file stdio.h. This file is called a header file, because it is usually included at the head of a program. It defines information about functions provided by a standard C library. The stdio.h header file contains declarations for the standard input and output functions available and must be included in the program to allow the use of the printf() function. Creating and Editing a Basic Program Exercise 1: Example C Program 1. Create a directory on your F drive to store your C programs: C:\TURBOC\MYLABS\ 2. Start the C programming environment. 3. Type in the following program code exactly as written below: /* exercise 1.1 Hello World */ /* This program prints the text */ /* HELLO WORLD on the PC monitor */ main() printf( HELLO WORLD \n ); 1. Save the file as lab1ex1.c 2. Compile the file using the Compile/compile to obj option 3. Link the code using the Compile/Link exe option 4. Execute the file using the Run/R option 5. From the OS shell print out all files in your C:\TURBOC\MYLABS\ directory There should now be 3 files called lab1ex1: lab1ex1.c, lab1ex1.obj, lab1ex1.exe

4 Sheet 4 of 14 Exercise 2: Modify the example Open the file lab1ex1.c Add the following line after the printf statement printf( \\n means New Line \t ); printf( \\t means Tab \n ); Save the file (lab1ex2.c) Compile, Link and Run the file What is displayed on the DOS screen? Exercise 3: Create a new file called lab1ex3.c which prints the following text on the PC monitor: Hello World My name is Joe Bloggs Goodbye World Save, Compile, Link and Run the file LAB 2: Fundamentals of C Objective: In this laboratory session you will learn: 4. The fundamental elements required to write a C programs 5. What is meant by a token in C. 6. What are the major data types used in C 7. What is meant by a keyword. 8. How to write a basic program to display different data types on the screen Declaring Variables A variable is a specific memory location set aside for a specific type of data and given a name for easy reference. The value stored in this memory location is variable, i.e. it can be changed. For example, if you are calculating the voltage across a fixed value of resistance as the current changes, the voltage variable would have a different value each time the current changed. Data Store resistance current voltage C statement to declare a memory location to store resistance values, where the value will be an integer (whole number), is as follows: int resistance; C statement to declare a memory location to store current values, where the value will be a real number, is as follows: float current; C statement to assign a value 200 to the variable called resistance is as follows: resistance = 200; C statement to assign a value 0.1 to the variable called current is as follows: current = 0.1; In C, all variables MUST be declared before they can be used in a program. To declare a variable, you must declare its type and identifier.

5 Sheet 5 of 14 Data Type Ranges C recognises the data types shown in the table below. NAME SIZE DETAILS COVERAGE int * signed integer System dependent unsigned int * unsigned System dependent char 1 signed char 128 to 127 unsigned char 1 none 0 to 255 short 2 signed short int 32,768 to 32,767 unsigned short 2 unsigned short int 0 to 65,535 long 4 signed long int 2,147,483,648 to 2,147,483,647 unsigned long 4 unsigned long int 0 to 4,294,967,295 enum * None Same as int float 4 None 3.4E +/- 38 (7 digits) double 8 None 1.7E +/- 308 (15 digits) long double 10 None 1.2E +/ (19 digits) The smallest location in memory which can be addressed is a byte, a byte consists of 8 bits, hence a byte can hold 256 possible numbers (2 8 ). An integer is normally 16 bits or 32 bits long. A float is normally 32 bits long. A char is 8 bits long Signed and unsigned are modifiers that can be used with any integral type. The char type is signed by default, but you can specify /J to make it unsigned by default. For example, a variable of data type integer can be declared as follows: int my_data; This piece of code creates an integer variable called my_data. To assign a value to this variable (load memory location) the C assignment operator (=) is used: my_data = 10; This line of code assigns the value 10 to the variable my_data. Note an integer variable can only store integer values. A float is used to declare a floating point variable. float more_data; /* declares a floating point variable called more_data */ more_data = 10.01; /* more_data now assigned a value of */ Example 2: Consider this piece of code. /******************************************************/ /* Add Two Numbers Program */ /******************************************************/ /* Developed by: A Programmer */ /* Date: Nov. 1, 1998 */ /******************************************************/ /* */ int number_1; /* first number */ int number_2; /* second number */ int result; /* result of addition */ /* */

6 Sheet 6 of 14 number_1 = 2; /* assign value 2 to number_1 */ number_2 = 5; /* assign value 5 to number_2 */ result = number_1 + number_2; printf( the first number is %d \n, number_1); printf( the second number is %d \n, number_2); printf( first number + second number = %d, result); Example 3: Consider this piece of code. /******************************************************/ /* Area of rectangleprogram */ /******************************************************/ /* Developed by: A Programmer */ /* Date: Nov. 1, 1998 */ /******************************************************/ main() float length; /* length of rectangle */ float width; /* width of rectangle */ float area; /* area of rectangle */ width =7.5; /* assign value 7.5 to width */ length = width; /* length assigned 11.4 longer width*/ area = length*width; /* multiplying to get area */ printf( the length is %f, and the width is %f \n, length, width ); printf( the area is %f \n,area); The %f and %d are called format specifications. They tell the printf function how the data should be printed. %d prints data as an integer %f prints data as a floating point number. There are many different format specifications which will be encountered as the course progresses. More Data Types: Some examples of data types were introduced: Integers can be declared using int, for example, int a,b,c; declares 3 integer variables called a,b and c. Floating Point numbers can be declared using float keyword. For example, float a,b,c; declares 3 float variables called a,b and c. Char data type. Another data type is the char, it is declared using the keyword char, for example: char a; /* declaration */ char a= a ; /* declaration and assignment */

7 Sheet 7 of 14 Double data type Double data type is a larger floating-point number (see the table in last weeks notes). It is declared using the keyword double. For example: double a; double a=10.05; printf Format Specifications Examples: Format Specifier Data Type Format Specifier Data Type %d Signed decimal integer %e Floating point exponential notation %f A floating point number. %o Unsigned octal integer %c A single character %u Unsigned decimal integer %s Text string %x Unsigned hexadecimal integer Exercises Exercise 4: Executing example 2 Start the TC environment and enter the code given above in example 2. Save the file as lab1ex4.c Save, Compile, Link and Run the file What is displayed on the DOS screen? Modify the values of number_1 and number_2 and recompile, link and execute: Did your program give the correct result? Exercise 5: Addition and Multiplication Modify the program is exercise 4 to do the following: Add number_1 and number_2 Multiply result by number_3 Print out the final result to your screen Save the file as lab1ex5.c, and compile, link and execute the program List the tests in your logbook you carried out to ensure your program was working correctly Exercise 6: Division Example Create a new file called lab1ex6.c to do the following: Assign the values 100 and 200 and 300 to three resistors R1 and R2 and R3. Calculate the resistance in series Rs = R1 + R2 + R3 Calculate the resistance in parallel Rp = 1/(1/R1 + 1/R2 + 1/R3) print out the resistance in series and resistance in parallel to your screen Save the file as lab1ex6.c, and compile, link and execute the program Draw a flow chart in your logbook for the program. Save the file as lab1ex6.c, and compile, link and execute the program Were the results as you expected? If not what modifications did you need to make to your program?

8 Sheet 8 of 14 LAB 3: Fundamentals of C: USER INPUT The scanf() function. The function scanf in stdio.h allows user data to be entered as the program is executing. It has the following form scanf( %f,&a); This will write floating-point data to the memory address where the variable is stored. Whenever & is placed in front of a variable it refers to the address where the data is stored. Example 1: scanf function. /* Getting user input. */ float value; /* A number inputted by the program user. */ printf("input a number => "); scanf("%f", &value); printf("the value is => %f", value); Example 2 /* Ohms Law */ float voltage; /* Value of the voltage. */ float current; /* Value of the current. */ float resistance; /* Value of the resistance. */ printf("input the current in amps => "); scanf("%f", &current); printf("input the resistance in ohms => "); scanf("%f", &resistance); voltage = current * resistance; /* Compute the voltage. */ printf("the value of the voltage is %f volts", voltage);

9 Sheet 9 of 14 Example 3 This example also illustrates another function for writing text to the screen: puts( the text you want ) It automatically places a new line at the end of the text. float fahrenheit_temp; float centigrade_temp; /* Explain program to user. */ puts(""); puts("this program will convert a temperature reading in"); puts("degrees Fahrenheit to its equivalent temperature in"); puts("degrees centigrade."); puts(""); puts("you only need to enter the temperature in Fahrenheit"); puts("and the program will do the rest."); /* Get Fahrenheit value from user. */ puts(""); printf("enter temperature value in Fahrenheit => "); scanf("%f", &fahrenheit_temp); /* Do computations. */ centigrade_temp = 5/9 * (fahrenheit_temp - 32); /* Display the answer. */ /* insert the final statement here */

10 Sheet 10 of 14 More on assigning values to variables. To assign a value to a variable (i.e. load value to a memory location) the C assignment operator (=) is used: The format is as follows variable_1 =10; This assigns the value 10 on the right of the = sign to variable variable_1 on the left of the = sign. The assignment statement can be combined with the declaration statement as follows: int variable_1 =10; This declares variable_1 as an integer and then assigns the value 10 to the variable. a=a+5; /* Assigns to the variable a value of +5, so if a was 10, it is now 15. */ In C this can also be written in shorthand as a+=5; Example 4; Examples of += -= and /=; int number = 10; /* Value of number for example. */ number += 5; printf("value of number += 5 is %d\n",number); number -= 3; printf("value of number -= 3 is %d\n",number); number *= 3; printf("value of number *= 3 is %d\n",number); number /= 5; printf("value of number /= 5 is %d\n",number); number %= 3; printf("value of number %%= 3 is %d\n",number);

11 Sheet 11 of 14 Exercises: Complete the following exercises, making sure that each program is saved on completion of each exercise. Ex1: Data Types Create a new program called program4.c as follows: char a_character; /* This declares a character. */ int an_integer; /* This declares an integer. */ float floating_point; /* This declares a floating point.*/ a_character = 'a'; an_integer = 15; floating_point = 27.62; printf("%c is the character.\n",a_character); printf("%d is the integer.\n",an_integer); printf("%f is the floating point.\n",floating_point); Modify the above program so the declaration and assignment statements are combined Save, Compile, Link and Run the file to confirm it works Save your working program as C:\TURBOC\MYLABS\lab3ex1.c Ex2: User Input of data Create a new program called lab3ex2.c Modify the program in exercise 1 so the program asks the user to input An integer number A floating point number A character Print out the three data types to your monitor as in exercise 1. Save, Compile, Link and Run the file to confirm it works Save your working program as C:\TURBOC\MYLABS\lab3ex2.c Ex3: Variable Assignments Create a new program called lab3ex3.c to do the following: 1. Assign value of 10 to a variable called var_1 2. Add 5 to the number and save result in var_1 3. Subtract 3 from the number and save result in var_1 4. Multiply number by 3 and save result in var_1 5. Divide number by 5 and save result in var_1 6. Print out the resulting number and save result in var_1 Save, Compile, Link and Run the file to confirm it works Save your working program as C:\TURBOC\MYLABS\lab3ex3.c

12 Sheet 12 of 14 Block Structured Programs LAB 4 In this section we will look at examples of programs and comment on their structure. A badly structured program may perform its function correctly, however, if the program is not easy to read and understand it will be very difficult to debug and modify. GOOD STRUCTURE => EASY TO READ, UNDERSTAND, DEBUG AND MODIFY Program Flow The programs we have seen so far are very simple, they runs straight through from the first statement to the last, and then stop. Often you will come across situations where your program must change what it does according to the data which is given to it. Basically there are three types of program flow : straight line ( Sequential Blocks ) chosen depending on a given condition (Branch Block) repeated according to a given condition (Loop Block) Every program ever written is composed of the three elements above, and very little else! You can use this to good effect when designing an overall view of how your program is going to work. FUNCTIONS C FUNCTION is an independent collection of source code designed to perform a specific task. Functions are identified by name and can return a single value. They act on parameters, which are used to pass information into them. We need to tell the compiler the name of our function, what parameters it has, and the type of information it returns. All programs have at least one function called main. We have seen examples of functions in the C Library, such as printf and scanf. These functions were called from the main function whenever data was to be displayed on the monitor or data input from the keyboard. Make your own simple functions We can also write our own functions to perform a particular task. For example, consider the follow program which calls a function called draw_line to display a line on the monitor. Example 1 using a function to perform a simple task /* Function prototype. */ void draw_line(void); /* This is the function we will use in our program*/ printf( This program calls a function to draw a single line\n\n ); draw_line(); /* call function to draw a line*/ printf( End of program\n ); /* Function Definition */ void draw_line(void) printf( ***********************\n );

13 Sheet 13 of 14 Example 2 using a function to perform a simple task #include <conio.h> /* Function prototype. */ void beeper(void); printf("press any key to continue program \n"); getch(); /* waits to get key input from keyboard */ beeper(); /* call function make a beep*/ /* Function Definition */ void beeper(void) printf("beep!!\a \n"); 1. Declaring a function: The FUNCTION PROTOTYPE is used to declare a function, i.e. tell the compiler the name of our function, what parameters it has, and the type of information it returns. void draw_line(void); void draw_line (void) tells us that the function does not return any data to main is the name of the function which we use in main to call the function tells us that no data is passed to the function 2. Defining a function: The FUNCTION DEFINITION describes exactly what action the function is to take. The first line of the function definition is similar in format to the function prototype but it does NOT require a semicolon. void draw_line(void) printf( ********************\n ); 3. Calling a Function The function is called using the function name, for example: draw_line(); will tell the program flow to go to the draw_line() function. The draw_line() code is then executed and on completion the program execution returns to the NEXT line of the calling function. Thus the above example has the following program execution flow: 1) printf( This program calls a function to draw a single line\n\n ); 2) printf( ********************\n ); 3) printf( End of program\n );

14 Sheet 14 of 14 Exercises: Simple Functions Exercises 1 Create complete programs to utilise the above examples 1. Compile and run the programs in step mode using Turbo C compiler. Save the programs in your area as C:\TurboC\mylabs\lab4ex1.c Exercises 2 Create complete programs to utilise the above examples 2. Compile and run the programs in step mode using Turbo C compiler. Look up conio.h under help and explain what the getch and getche function is used for. Save the programs in your area as C:\TurboC\mylabs\lab4ex2.c Exercises 3 Modify the program in exercise 1, so that the program displays a rectangle as follows: *********************** *********************** *********************** *********************** Use two functions: draw_rectangle and draw_line in thus program, where main calls the draw_rectangle function and draw_rectangle calls the draw_line function. Save the program in your area as F:\ clabs\lab4ex3.c Exercises 4 Create a program using the functions from exercise 2 and 3 can be used to display a rectangle, then beep and ask the user to hit enter to display the rectangle again. (hint: use getch function to wait for user to enter any character on keyboard before the program continues) Save the program in your area as F:\ clabs\lab4ex4.c Exercise 5 Create a program using a simple function to display a Christmas tree composed of stars. Save the program in your area as F:\ clabs\lab4ex5.c

C Programming Dr. Hasan Demirel

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

More information

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

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,

More information

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T) Unit- I Introduction to c Language: C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating

More information

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

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

More information

C Syntax and Semantics

C Syntax and Semantics C Syntax and Semantics 1 C Program Structure C Language Elements Preprocessor directives Function Header, and Function body Executable statements Reserved word, Standard identifiers, user defined identifiers

More information

INTRODUCTION TO FLOWCHARTING

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

More information

Informatica e Sistemi in Tempo Reale

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)

More information

Basic Common Unix commands: Change to directory d

Basic Common Unix commands: Change to directory d Basic Common Unix commands: cd d Change to directory d mkdir d rmdir d mv f1 [f2...] d mv d1 d2 ls [d] [f...] ls -1 [f...] vi [f] emacs [f] more f cp f1 f2 mv f1 f2 rm f gcc [-o f1] f2 gnuplot Create new

More information

The programming language C. sws1 1

The programming language C. sws1 1 The programming language C sws1 1 The programming language C invented by Dennis Ritchie in early 1970s who used it to write the first Hello World program C was used to write UNIX Standardised as K&C (Kernighan

More information

Introduction to C Language

Introduction to C Language Introduction to C Language A look at C We are going to learn a language called C. C is a very flexible and powerful programming language originally designed in the early 1970s. It is famous as the language

More information

Lecture 03 Bits, Bytes and Data Types

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

More information

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

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

More information

The Basics of C Programming. Marshall Brain

The Basics of C Programming. Marshall Brain The Basics of C Programming Marshall Brain Last updated: October 30, 2013 Contents 1 C programming 1 What is C?................................. 2 The simplest C program, I........................ 2 Spacing

More information

Birla Institute of Technology &Science, Pilani Computer Programming (CS F111) Second Semester Lab-3 (Introduction to C Programming Language)

Birla Institute of Technology &Science, Pilani Computer Programming (CS F111) Second Semester Lab-3 (Introduction to C Programming Language) Topics to be covered: 1. C Program structure and execution 2. Data type 3. Reading input and printing output 4. Expression 5. Operator precedency 6. Typecasting Birla Institute of Technology &Science,

More information

Programming Fundamental. Instructor Name: Lecture-2

Programming Fundamental. Instructor Name: Lecture-2 Programming Fundamental Instructor Name: Lecture-2 Today s Lecture What is Programming? First C++ Program Programming Errors Variables in C++ Primitive Data Types in C++ Operators in C++ Operators Precedence

More information

Lecture 1 Notes: Introduction

Lecture 1 Notes: Introduction Introduction to C++ January 4, 2011 Massachusetts Institute of Technology 6.096 Lecture 1 Notes: Introduction 1 Compiled Languages and C++ 1.1 Why Use a Language Like C++? At its core, a computer is just

More information

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

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

More information

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

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,

More information

Arrays. Arrays, Argument Passing, Promotion, Demotion

Arrays. Arrays, Argument Passing, Promotion, Demotion Arrays Arrays, Argument Passing, Promotion, Demotion Review Introduction to C C History Compiling C Identifiers Variables Declaration, Definition, Initialization Variable Types Logical Operators Control

More information

LC-3 Assembly Language

LC-3 Assembly Language LC-3 Assembly Language Programming and tips Textbook Chapter 7 CMPE12 Summer 2008 Assembly and Assembler Machine language - binary Assembly language - symbolic 0001110010000110 An assembler is a program

More information

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

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....................................

More information

PROGRAMMING IN C PROGRAMMING IN C CONTENT AT A GLANCE

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 :

More information

IN THIS CHAPTER,YOU ARE INTRODUCED to the C language so that you can see what

IN THIS CHAPTER,YOU ARE INTRODUCED to the C language so that you can see what 3 Compiling and Running Your First Program IN THIS CHAPTER,YOU ARE INTRODUCED to the C language so that you can see what programming in C is all about.what better way to gain an appreciation for this language

More information

198:211 Computer Architecture

198:211 Computer Architecture 198:211 Computer Architecture Topics: Lecture 8 (W5) Fall 2012 Data representation 2.1 and 2.2 of the book Floating point 2.4 of the book 1 Computer Architecture What do computers do? Manipulate stored

More information

So far we have considered only numeric processing, i.e. processing of numeric data represented

So far we have considered only numeric processing, i.e. processing of numeric data represented Chapter 4 Processing Character Data So far we have considered only numeric processing, i.e. processing of numeric data represented as integer and oating point types. Humans also use computers to manipulate

More information

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

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

More information

Introduction to Python

Introduction to Python WEEK ONE Introduction to Python Python is such a simple language to learn that we can throw away the manual and start with an example. Traditionally, the first program to write in any programming language

More information

C PROGRAMMING FOR MATHEMATICAL COMPUTING

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

More information

About The Tutorial. Audience. Prerequisites. Copyright & Disclaimer

About The Tutorial. Audience. Prerequisites. Copyright & Disclaimer About The Tutorial C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system.

More information

First Bytes Programming Lab 2

First Bytes Programming Lab 2 First Bytes Programming Lab 2 This lab is available online at www.cs.utexas.edu/users/scottm/firstbytes. Introduction: In this lab you will investigate the properties of colors and how they are displayed

More information

6.087 Lecture 1 January 11, 2010

6.087 Lecture 1 January 11, 2010 6.087 Lecture 1 January 11, 2010 Introduction to C Writing C Programs Our First C Program 1 What is C? Dennis Ritchie AT&T Bell Laboratories 1972 16-bit DEC PDP-11 computer (right) Widely used today extends

More information

Primitive Data Types Summer 2010 Margaret Reid-Miller

Primitive Data Types Summer 2010 Margaret Reid-Miller Primitive Data Types 15-110 Summer 2010 Margaret Reid-Miller Data Types Data stored in memory is a string of bits (0 or 1). What does 1000010 mean? 66? 'B'? 9.2E-44? How the computer interprets the string

More information

CP Lab 2: Writing programs for simple arithmetic problems

CP Lab 2: Writing programs for simple arithmetic problems Computer Programming (CP) Lab 2, 2015/16 1 CP Lab 2: Writing programs for simple arithmetic problems Instructions The purpose of this Lab is to guide you through a series of simple programming problems,

More information

CS 16: Assembly Language Programming for the IBM PC and Compatibles

CS 16: Assembly Language Programming for the IBM PC and Compatibles CS 16: Assembly Language Programming for the IBM PC and Compatibles First, a little about you Your name Have you ever worked with/used/played with assembly language? If so, talk about it Why are you taking

More information

The C Programming Language course syllabus associate level

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

More information

Scripting with TCL, Part 1

Scripting with TCL, Part 1 Scripting with TCL, Part 1 Axel Kohlmeyer Center for Molecular Modeling University of Pennsylvania SBS 2007 @ JNCASR, Bangalore The VMD Execution Model GUI (FLTK) Internal State Visualization Python Interpreter

More information

Pemrograman Dasar. Basic Elements Of Java

Pemrograman Dasar. Basic Elements Of Java Pemrograman Dasar Basic Elements Of Java Compiling and Running a Java Application 2 Portable Java Application 3 Java Platform Platform: hardware or software environment in which a program runs. Oracle

More information

Introduction to Java

Introduction to Java Introduction to Java The HelloWorld program Primitive data types Assignment and arithmetic operations User input Conditional statements Looping Arrays CSA0011 Matthew Xuereb 2008 1 Java Overview A high

More information

Automatic Threshold Values and Variables

Automatic Threshold Values and Variables Automatic Threshold Values and Variables In this lesson, we re going to look a little deeper into the world of values, and pay special attention to the programming structures that are used to represent

More information

Access Tutorial 12: An Introduction to Visual Basic

Access Tutorial 12: An Introduction to Visual Basic Access Tutorial 12: An Introduction to Visual Basic 12.1 Introduction: Learning the basics of programming Programming can be an enormously complex and difficult activity. Or it can be quite straightforward.

More information

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

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

More information

2 ASCII TABLE (DOS) 3 ASCII TABLE (Window)

2 ASCII TABLE (DOS) 3 ASCII TABLE (Window) 1 ASCII TABLE 2 ASCII TABLE (DOS) 3 ASCII TABLE (Window) 4 Keyboard Codes The Diagram below shows the codes that are returned when a key is pressed. For example, pressing a would return 0x61. If it is

More information

Base Conversion written by Cathy Saxton

Base Conversion written by Cathy Saxton Base Conversion written by Cathy Saxton 1. Base 10 In base 10, the digits, from right to left, specify the 1 s, 10 s, 100 s, 1000 s, etc. These are powers of 10 (10 x ): 10 0 = 1, 10 1 = 10, 10 2 = 100,

More information

We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share.

We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share. LING115 Lecture Note Session #4 Python (1) 1. Introduction As we have seen in previous sessions, we can use Linux shell commands to do simple text processing. We now know, for example, how to count words.

More information

Computer Science 281 Binary and Hexadecimal Review

Computer Science 281 Binary and Hexadecimal Review Computer Science 281 Binary and Hexadecimal Review 1 The Binary Number System Computers store everything, both instructions and data, by using many, many transistors, each of which can be in one of two

More information

VHDL Test Bench Tutorial

VHDL Test Bench Tutorial University of Pennsylvania Department of Electrical and Systems Engineering ESE171 - Digital Design Laboratory VHDL Test Bench Tutorial Purpose The goal of this tutorial is to demonstrate how to automate

More information

The Answer to the 14 Most Frequently Asked Modbus Questions

The Answer to the 14 Most Frequently Asked Modbus Questions Modbus Frequently Asked Questions WP-34-REV0-0609-1/7 The Answer to the 14 Most Frequently Asked Modbus Questions Exactly what is Modbus? Modbus is an open serial communications protocol widely used in

More information

First Java Programs. V. Paúl Pauca. CSC 111D Fall, 2015. Department of Computer Science Wake Forest University. Introduction to Computer Science

First Java Programs. V. Paúl Pauca. CSC 111D Fall, 2015. Department of Computer Science Wake Forest University. Introduction to Computer Science First Java Programs V. Paúl Pauca Department of Computer Science Wake Forest University CSC 111D Fall, 2015 Hello World revisited / 8/23/15 The f i r s t o b l i g a t o r y Java program @author Paul Pauca

More information

Chapter One Introduction to Programming

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

More information

Secrets of printf. 1 Background. 2 Simple Printing. Professor Don Colton. Brigham Young University Hawaii. 2.1 Naturally Special Characters

Secrets of printf. 1 Background. 2 Simple Printing. Professor Don Colton. Brigham Young University Hawaii. 2.1 Naturally Special Characters Secrets of Professor Don Colton Brigham Young University Hawaii is the C language function to do formatted printing. The same function is also available in PERL. This paper explains how works, and how

More information

Illustration 1: Diagram of program function and data flow

Illustration 1: Diagram of program function and data flow The contract called for creation of a random access database of plumbing shops within the near perimeter of FIU Engineering school. The database features a rating number from 1-10 to offer a guideline

More information

Number Representation

Number Representation Number Representation CS10001: Programming & Data Structures Pallab Dasgupta Professor, Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Topics to be Discussed How are numeric data

More information

C++ Language Tutorial

C++ Language Tutorial cplusplus.com C++ Language Tutorial Written by: Juan Soulié Last revision: June, 2007 Available online at: http://www.cplusplus.com/doc/tutorial/ The online version is constantly revised and may contain

More information

2 Programs: Instructions in the Computer

2 Programs: Instructions in the Computer 2 2 Programs: Instructions in the Computer Figure 2. illustrates the first few processing steps taken as a simple CPU executes a program. The CPU for this example is assumed to have a program counter (PC),

More information

2010/9/19. Binary number system. Binary numbers. Outline. Binary to decimal

2010/9/19. Binary number system. Binary numbers. Outline. Binary to decimal 2/9/9 Binary number system Computer (electronic) systems prefer binary numbers Binary number: represent a number in base-2 Binary numbers 2 3 + 7 + 5 Some terminology Bit: a binary digit ( or ) Hexadecimal

More information

In this lecture you will learn:

In this lecture you will learn: Data Types and Variables Imed Hammouda Department of Software Systems Tampere University of Technology Objectives In this lecture you will learn: What is a data type and how types are represented in C++.

More information

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. 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

More information

Introduction to Programming

Introduction to Programming Introduction to Programming SS 2012 Adrian Kacso, Univ. Siegen adriana.dkacsoa@duni-siegena.de Tel.: 0271/740-3966, Office: H-B 8406 Stand: April 25, 2012 Betriebssysteme / verteilte Systeme Introduction

More information

MS ACCESS DATABASE DATA TYPES

MS ACCESS DATABASE DATA TYPES MS ACCESS DATABASE DATA TYPES Data Type Use For Size Text Memo Number Text or combinations of text and numbers, such as addresses. Also numbers that do not require calculations, such as phone numbers,

More information

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 (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

More information

Computer Programming Tutorial

Computer Programming Tutorial Computer Programming Tutorial COMPUTER PROGRAMMING TUTORIAL by tutorialspoint.com tutorialspoint.com i ABOUT THE TUTORIAL Computer Prgramming Tutorial Computer programming is the act of writing computer

More information

Input and Output in C

Input and Output in C M. Campbell 1993 Deakin University Aim Learning objectives Content After working through this module you should be able to create C programs that fully utilise the input/output libraries to read data

More information

FEEG6002 - Applied Programming 5 - Tutorial Session

FEEG6002 - Applied Programming 5 - Tutorial Session FEEG6002 - Applied Programming 5 - Tutorial Session Sam Sinayoko 2015-10-30 1 / 38 Outline Objectives Two common bugs General comments on style String formatting Questions? Summary 2 / 38 Objectives Revise

More information

Chapter 3. Input and output. 3.1 The System class

Chapter 3. Input and output. 3.1 The System class Chapter 3 Input and output The programs we ve looked at so far just display messages, which doesn t involve a lot of real computation. This chapter will show you how to read input from the keyboard, use

More information

Fundamentals of Programming

Fundamentals of Programming Fundamentals of Programming Introduction to the C language Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa February 29, 2012 G. Lipari (Scuola Superiore Sant Anna) The C language

More information

Signed Binary Arithmetic

Signed Binary Arithmetic Signed Binary Arithmetic In the real world of mathematics, computers must represent both positive and negative binary numbers. For example, even when dealing with positive arguments, mathematical operations

More information

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. Exam Name MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. 1) The JDK command to compile a class in the file Test.java is A) java Test.java B) java

More information

Introduction to Python

Introduction to Python Caltech/LEAD Summer 2012 Computer Science Lecture 2: July 10, 2012 Introduction to Python The Python shell Outline Python as a calculator Arithmetic expressions Operator precedence Variables and assignment

More information

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) 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

More information

The C Programming Language

The C Programming Language Chapter 1 The C Programming Language In this chapter we will learn how to write simple computer programs using the C programming language; perform basic mathematical calculations; manage data stored in

More information

CHAPTER 3 Numbers and Numeral Systems

CHAPTER 3 Numbers and Numeral Systems CHAPTER 3 Numbers and Numeral Systems Numbers play an important role in almost all areas of mathematics, not least in calculus. Virtually all calculus books contain a thorough description of the natural,

More information

Writing Portable Programs COS 217

Writing Portable Programs COS 217 Writing Portable Programs COS 217 1 Goals of Today s Class Writing portable programs in C Sources of heterogeneity Data types, evaluation order, byte order, char set, Reading period and final exam Important

More information

UIL Computer Science for Dummies by Jake Warren and works from Mr. Fleming

UIL Computer Science for Dummies by Jake Warren and works from Mr. Fleming UIL Computer Science for Dummies by Jake Warren and works from Mr. Fleming 1 2 Foreword First of all, this book isn t really for dummies. I wrote it for myself and other kids who are on the team. Everything

More information

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

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

More information

CS 241 Data Organization Coding Standards

CS 241 Data Organization Coding Standards CS 241 Data Organization Coding Standards Brooke Chenoweth University of New Mexico Spring 2016 CS-241 Coding Standards All projects and labs must follow the great and hallowed CS-241 coding standards.

More information

Functions. Recursion

Functions. Recursion CandC++ 2. Functions Preprocessor Stephen Clark University of Cambridge (heavily based on last year s notes (Andrew Moore) with thanks to Alastair R. Beresford and Bjarne Stroustrup) Michaelmas Term 2011

More information

Introduction to the TI-83/TI-83+ and TI-84+ for College Algebra.

Introduction to the TI-83/TI-83+ and TI-84+ for College Algebra. Introduction to the TI-83/TI-83+ and TI-84+ for College Algebra. Turning it on and off: To turn the calculator on, press the ON key in the lower left corner. You should now see a flashing rectangle, the

More information

C programming: exercise sheet L2-STUE (2011-2012)

C programming: exercise sheet L2-STUE (2011-2012) C programming: exercise sheet L2-STUE (2011-2012) Algorithms and Flowcharts Exercise 1: comparison Write the flowchart and associated algorithm that compare two numbers a and b. Exercise 2: 2 nd order

More information

arrays C Programming Language - Arrays

arrays C Programming Language - Arrays arrays So far, we have been using only scalar variables scalar meaning a variable with a single value But many things require a set of related values coordinates or vectors require 3 (or 2, or 4, or more)

More information

Comp151. Definitions & Declarations

Comp151. Definitions & Declarations Comp151 Definitions & Declarations Example: Definition /* reverse_printcpp */ #include #include using namespace std; int global_var = 23; // global variable definition void reverse_print(const

More information

Pseudo code Tutorial and Exercises Teacher s Version

Pseudo code Tutorial and Exercises Teacher s Version Pseudo code Tutorial and Exercises Teacher s Version Pseudo-code is an informal way to express the design of a computer program or an algorithm in 1.45. The aim is to get the idea quickly and also easy

More information

Keil C51 Cross Compiler

Keil C51 Cross Compiler Keil C51 Cross Compiler ANSI C Compiler Generates fast compact code for the 8051 and it s derivatives Advantages of C over Assembler Do not need to know the microcontroller instruction set Register allocation

More information

TN203. Porting a Program to Dynamic C. Introduction

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

More information

PROG0101 Fundamentals of Programming PROG0101 FUNDAMENTALS OF PROGRAMMING. Chapter 3 Algorithms

PROG0101 Fundamentals of Programming PROG0101 FUNDAMENTALS OF PROGRAMMING. Chapter 3 Algorithms PROG0101 FUNDAMENTALS OF PROGRAMMING Chapter 3 1 Introduction to A sequence of instructions. A procedure or formula for solving a problem. It was created mathematician, Mohammed ibn-musa al-khwarizmi.

More information

Phys4051: C Lecture 2 & 3. Comment Statements. C Data Types. Functions (Review) Comment Statements Variables & Operators Branching Instructions

Phys4051: C Lecture 2 & 3. Comment Statements. C Data Types. Functions (Review) Comment Statements Variables & Operators Branching Instructions Phys4051: C Lecture 2 & 3 Functions (Review) Comment Statements Variables & Operators Branching Instructions Comment Statements! Method 1: /* */! Method 2: // /* Single Line */ //Single Line /* This comment

More information

University of Hull Department of Computer Science. Wrestling with Python Week 01 Playing with Python

University of Hull Department of Computer Science. Wrestling with Python Week 01 Playing with Python Introduction Welcome to our Python sessions. University of Hull Department of Computer Science Wrestling with Python Week 01 Playing with Python Vsn. 1.0 Rob Miles 2013 Please follow the instructions carefully.

More information

Object-Oriented Programming in Java

Object-Oriented Programming in Java CSCI/CMPE 3326 Object-Oriented Programming in Java Class, object, member field and method, final constant, format specifier, file I/O Dongchul Kim Department of Computer Science University of Texas Rio

More information

Comp Arrays and Pointers. Class Notes. T h e G r o u p o f T h r e e

Comp Arrays and Pointers. Class Notes. T h e G r o u p o f T h r e e Comp 2401 Arrays and Pointers Class Notes 2013 T h e G r o u p o f T h r e e Introduction To Arrays: In C programming, one of the frequently problem is to handle similar types of data. For example: if

More information

Activity 1: Bits and Bytes

Activity 1: Bits and Bytes ICS3U (Java): Introduction to Computer Science, Grade 11, University Preparation Activity 1: Bits and Bytes The Binary Number System Computers use electrical circuits that include many transistors and

More information

PHP. Intro, Syntax, Variables, Echo, Data Types

PHP. Intro, Syntax, Variables, Echo, Data Types PHP Intro, Syntax, Variables, Echo, Data Types Introduction PHP scripts are executed on the server. What You Should Already Know Before you continue you should have a basic understanding of the following:

More information

2011, The McGraw-Hill Companies, Inc. Chapter 3

2011, The McGraw-Hill Companies, Inc. Chapter 3 Chapter 3 3.1 Decimal System The radix or base of a number system determines the total number of different symbols or digits used by that system. The decimal system has a base of 10 with the digits 0 through

More information

qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq

qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq Introduction to Programming using Java wertyuiopasdfghjklzxcvbnmqwertyui

More information

Java CPD (I) Frans Coenen Department of Computer Science

Java CPD (I) Frans Coenen Department of Computer Science Java CPD (I) Frans Coenen Department of Computer Science Content Session 1, 12:45-14:30 (First Java Programme, Inheritance, Arithmetic) Session 2, 14:45-16:45 (Input and Programme Constructs) Materials

More information

Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is

Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is preceded by an equal sign d. its name has undereline 2. Associations

More information

Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems

Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems This assignment is designed to familiarize you with different numbering systems, specifically: binary, octal, hexadecimal (and decimal)

More information

C++ Programming Language

C++ Programming Language C++ Programming Language Lecturer: Yuri Nefedov 7th and 8th semesters Lectures: 34 hours (7th semester); 32 hours (8th semester). Seminars: 34 hours (7th semester); 32 hours (8th semester). Course abstract

More information

Standard printing function in C is printf Prints everything numbers, strings, etc. May be complex to use. Standard C library is called libc

Standard printing function in C is printf Prints everything numbers, strings, etc. May be complex to use. Standard C library is called libc Arrays and Structs and Pointers, Oh My! Programming in C Input and output Using printf Standard input and output Pointers Arrays Structures Combining these things together Arrays and Structs and Pointers,

More information

ASCII Encoding. The char Type. Manipulating Characters. Manipulating Characters

ASCII Encoding. The char Type. Manipulating Characters. Manipulating Characters The char Type ASCII Encoding The C char type stores small integers. It is usually 8 bits. char variables guaranteed to be able to hold integers 0.. +127. char variables mostly used to store characters

More information

Lecture 5: Java Fundamentals III

Lecture 5: Java Fundamentals III Lecture 5: Java Fundamentals III School of Science and Technology The University of New England Trimester 2 2015 Lecture 5: Java Fundamentals III - Operators Reading: Finish reading Chapter 2 of the 2nd

More information

C++ INTERVIEW QUESTIONS

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

More information