Don't wait for the right time for studying... It won't come.
--Your friends at LectureNotes

Note for Programming in C - C By Subba Rao

  • Programming in C - C
  • Note
  • Jawaharlal Nehru Technological University Anantapur (JNTU) College of Engineering (CEP), Pulivendula, Pulivendula, Andhra Pradesh, India - JNTUACEP
  • Computer Science Engineering
  • 23 Topics
  • 477 Offline Downloads
  • Uploaded 1 year ago
0 User(s)
Download PDFOrder Printed Copy

Share it with your friends

Leave your Comments

Text from page-2

This watermark does not appear in the registered version - http://www.clicktoconvert.com 2 SR-IT Institute @ Beeramguda. Letters Uppercase A….Z Lowercase a…..z Digits All decimal digits 0…..9 & Ampersand . Period ^ Caret ; Semicolon * Asterisk : Colon - Minus ? Question mark + Plus sign ‘ Apostrophe < “ Quotation mark > ! Exclamation ( Greater than Left parenthesis ) Right parentheses [ Left bracket In / Slash Less than st | Vertical Bar itu , Comma te Special characters ] Right bracket ~ Tilde { Left brace _ Underscore } Right brace $ Dollar sign # Number sign -IT \ Back slash SR % Percent sign White Spaces Ø Ø Ø Ø Ø Blank Space Horizontal Tab Carriage Return New Line Form Feed Tri-graph Characters Many non- English keyboards do not support all the characters. ANSI C introduces the concept of “Trigraph” sequences to provide a way to enter certain characters that are not available on some keyboards. Ph: 8801948390, 7396252455.

Text from page-3

This watermark does not appear in the registered version - http://www.clicktoconvert.com 3 SR-IT Institute @ Beeramguda. Translation ??= # Number sign ??( [ Left bracket ??) ] Right bracket ??< { Left brace ??> } Right brace ??! | Vertical bar ??/ ??’ ??- \ Back slash ^ Caret ~ Tilde te 1.3 Trigraph Sequence C TOKENS itu In C programs, the smallest individual units are known as tokens. In st C TOKENS Constants float while -15.5 100 -IT Keywords Identifiers SR main amount 1.4 Strings Operators “ABC” “year” +*, Special symbols [ ] { } KEYWORDS AND IDENTIFIERS Every C word is classified as either a keyword or an identifier. All keywords have fixed meanings and these meanings cannot be changed. Eg: auto, break, char, void etc., Identifiers refer to the names of variables, functions and arrays. They are user-defined names and consist of a sequence of letters and digits, with a letter as a first character. Both uppercase and lowercase letters are permitted. The underscore character is also permitted in identifiers. Ph: 8801948390, 7396252455.

Text from page-4

This watermark does not appear in the registered version - http://www.clicktoconvert.com 4 SR-IT Institute @ Beeramguda. 1.5 CONSTANTS Constants in C refer to fixed values that do not change during the execution of a program. CONSTANTS Integer constants Character Constants Real constants Single character constants itu Integer Constants String constants te Numeric Constants An integer constant refers to a sequence of digits, There are three types integers, namely, decimal, octal, and hexa decimal. st Decimal Constant Eg:123,-321 etc., Eg: 1) 15 750 In Note: Embedded spaces, commas and non-digit characters are not permitted between digits. 2)$1000 -IT Octal Constant SR An octal integer constant consists of any combination of digits from the set 0 through 7, with a leading 0. Eg: 1) 037 2) 0435 Hexadecimal Constant A sequence of digits preceded by 0x or 0X is considered as hexadecimal integer. They may also include alphabets A through F or a through f. Eg: 1) 0X2 2) 0x9F 3) 0Xbcd Ph: 8801948390, 7396252455.

Text from page-5

This watermark does not appear in the registered version - http://www.clicktoconvert.com 5 SR-IT Institute @ Beeramguda. Program for representation of integer constants on a 16-bit computer. /*Integer numbers on a 16-bit machine*/ main() { printf(“Integer values\n\n”); printf(“%d%d%d\n”,32767,32767+1,32767+10); printf(“\n”); printf(“Long integer values\n\n”); printf(“%ld%ld%ld\n”,32767L,32767L+1L,32767L+10L); } itu te OUTPUT Integer values 32767 -32768 -32759 Long integer values 32767 32768 32777 Real Constants st Certain quantities that vary continuously, such as distances, heights etc., are represented by numbers containing functional parts like 17.548.Such numbers are called real (or floating point)constants. In Eg:0.0083,-0.75 etc., A real number may also be expressed in exponential or scientific notation. Eg:215.65 may be written as 2.1565e2 -IT Single Character Constants SR A single character constants contains a single character enclosed within a pair of single quote marks. Eg: ’5’ ‘X’ ‘;’ String Constants A string constant is a sequence of characters enclosed in double quotes. The characters may be letters, numbers, special characters and blank space. Eg:”Hello!” “1987” “?….!” Backslash Character Constants C supports special backslash character constants that are used in output functions. These character combinations are known as escape sequences. Ph: 8801948390, 7396252455.

Lecture Notes