five tips to success. work hard try more exercises and more practice

24
Five Tips to Success

Upload: amice-rice

Post on 12-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Five Tips to Success. Work hard Try more exercises and more practice

Five Tips to Success

Page 2: Five Tips to Success. Work hard Try more exercises and more practice

Work hard

Page 3: Five Tips to Success. Work hard Try more exercises and more practice

Try more exercises and more practice

Page 4: Five Tips to Success. Work hard Try more exercises and more practice

Do the labs and assignments yourself

Page 5: Five Tips to Success. Work hard Try more exercises and more practice

Be patient with the machine

Page 6: Five Tips to Success. Work hard Try more exercises and more practice

If you really need that, do it quietly ...

But not in Class. What you have to do is just inform me about your situation and I will not mark your absent.

Page 7: Five Tips to Success. Work hard Try more exercises and more practice

What is C?

C is a programming language.It was developed in 1972 USA.It was designed and written by a man named

dennis ritchie.C is the base for all computer languages like

C++, java etc.Major parts of popular operating systems like

Windows, UNIX, Linux are still written in C.

Page 8: Five Tips to Success. Work hard Try more exercises and more practice

Getting Started with C

Communicating with a computer involves speaking the language the computer under stands.

As in learning of English language first we learn English alphabets, which forms a word, words combine to form a sentence and sentences forms a paragraph.

Like English language we must have to learn alphabets, numbers and symbols which are used in C.

Page 9: Five Tips to Success. Work hard Try more exercises and more practice

Steps in learning English language

Alphabets

Words

Sentences

Paragraphs

Page 10: Five Tips to Success. Work hard Try more exercises and more practice

Steps in learning C

Alphabets, Digits, Special symbol

Constants, Variables, Keywords

Instructions

Programs

Page 11: Five Tips to Success. Work hard Try more exercises and more practice

The C character Set

A character denotes any alphabet, digit or special symbol used to represent information.

Page 12: Five Tips to Success. Work hard Try more exercises and more practice

Alphabets

Digits

Special symbols

A,B,….,Y,Z

a,b,….,y,z

0,1,2,3,4,5,6,7,8,9

~ ` ! # @ % ^ & *

( ) _ - + = I { } [ ] : ; “ < > , . ? /

Page 13: Five Tips to Success. Work hard Try more exercises and more practice

Constants, Variables and Keywords

The alphabets, numbers and special symbols when properly combine form constants ,variables and keywords.

Any entity that doesn`t change is called constant.

Any entity that may change is called variable.

Page 14: Five Tips to Success. Work hard Try more exercises and more practice

3 5X X

3 is stored in a memory location and a name X is given to it. we assign a new value 5 to thesame memory location X. So the location X canHold different values. 3 and 5 cannot change.

Page 15: Five Tips to Success. Work hard Try more exercises and more practice

Types of C constants

C constants can be divided into two major categories:

(a) Primary constants(b) Secondary Constants These are further categorized as

Page 16: Five Tips to Success. Work hard Try more exercises and more practice

Interger Constant

Real Constant

Character constant

SecondaryConstants

ArrayPointer

StructureUnion

Enum. etc.

PrimaryConstants

C Constants

Page 17: Five Tips to Success. Work hard Try more exercises and more practice

Rules for constructing Integer constants

(a) An integer constant must have at least one digit.(b) It must not have a decimal point.(c) It can be either positive or negative.(d) If no sign precedes an integer constant, it is

assumed to be positive.(e) No commas or blanks are allowed within an

integer constant.

Page 18: Five Tips to Success. Work hard Try more exercises and more practice

(f) The allowable range for integer constants is -32768 to 32767.The range of integer constant depend upon

the compiler. for a 16-bit complier like Turbo C or Turbo C++ the range is -32768 to 32767. working with a 16-bit complier

Ex: 426 +782 -8000 -7605

Page 19: Five Tips to Success. Work hard Try more exercises and more practice

Rules for Constructing Real Constants

Real constants are often called Floating Point constants.

It may be in fractional and Exponential form.

Following rules must be followed for constructing real constants expressed in fractional form:

Page 20: Five Tips to Success. Work hard Try more exercises and more practice

(a)A real constant must have at least one digit.(b) It must have a decimal point.(c) It could be either positive or negative.(d) Default sign is positive.(e) No commas or blanks are allowed within a real constants. Ex:+325.34 426.0 -32.76 -48.5792

Page 21: Five Tips to Success. Work hard Try more exercises and more practice

The exponential form of representation of real constants is usually used if the value of the constant is either too small or too large.

The real constant is represented in two parts . The part appearing before “e” is called mantissa and the part following “e” is called exponent.

0.000342 can be represented in exponential form as 3.42e-4.

Following rules must be observed by constructing constants expressed in exponential form:

Page 22: Five Tips to Success. Work hard Try more exercises and more practice

(a) The mantissa part and the exponential part should be separated by a letter e or E.(b) The mantissa part may have a positive or

negative sign.(c) Default sign of mantissa part is positive.(d) The exponent must have at least one digit,

must be a positive or negative integer. Default sign is positive.

(e) Range of real constants expressed in exponential form is -3.4e38 to 3.4e38.

Ex: +3.2e-5 4.1e8 -0.2E+3 -3.2e-5

Page 23: Five Tips to Success. Work hard Try more exercises and more practice

Rules for constructing Character Constants

(a) A character constant is a single alphabet, single digit or a single special symbol enclosed within single inverted commas. Both the inverted commas should point to the left. For example `a` is a valid character constant whereas `A` is not.

(b) The maximum length of a character constant can be 1 character.

Ex: `A` `I` `5` `=`

Page 24: Five Tips to Success. Work hard Try more exercises and more practice

The End