Вы находитесь на странице: 1из 7

C, C++, Java, Python, PHP,

JavaScript and Linux For


Beginners
Manjunath.R
Manjunath.R

This document is overwritten when you make changes in Play Books.


You should make a copy of this document before you edit it.

23 notes/highlights
Created by Luca Moldovan – Last synced June 16, 2020

C, C++, Java, Python, PHP, JavaScript and Linux For


Beginners

Char i

June 16, 2020

rqponmlkjih9g8f7e6d i

June 16, 2020


C Keywords

C Keywords auto double int struct break else long 1


switch case enum register typedef char extern return
union continue for signed void do if static while
default goto sizeof volatile const float short unsigned
Special Characters in C Programming , < > . _ ( ) ;
$:%[]#?'&{}"^!*/|-\~+

principale

June 16, 2020

C Constants Primary Secondary Numeric Array, Pointer, Structure, 1


Union etc. Non-numeric Integer Floating-point Character • Integer
→ 246, 0, -3679, +35, 9777, -36026 etc. • Floating-point → 246.23,
0000.23, -36.79, +35.56, • Character → 'b', '?', '@', '#' etc. • String
→ "C", "Java", "Python", 9.777, "JavaScript" etc. String -360.216

principale

June 16, 2020

Data Types:

Data types: Types Size in bytes Keyword Integer 2 int 2


Floating-point 4 float Double 8 double Character 1
char Escape Sequences: Sequence Meaning \a
System alarm (bell) \b Backspace \f Form feed \n
Newline \r Carriage Return \t Horizontal Tab \v
Vertical Tab \\ Backslash \' Single quote
June 16, 2020

\" Double quote \? Question mark \0 End of string 2


Input output functions: Input Output Formatted
scanf() printf() Unformatted getchar() gets()
putchar()

June 16, 2020

Format SpecifierMeaning%c Read a Single Character 3


%d Read a Decimal integer %e Read a Floating-point
number %f Read a Floating-point number %g Read a
Floating-point number %h Read a short integer %i
Read a Decimal or hexadecimal or octal number %o
Read an octal number %p Read a pointer%s Read a
string%u Read an Unsigned integer %x Read a
hexadecimal number %n Prints nothing %%Prints %
character

June 16, 2020

Logical Relational 3

June 16, 2020

C Operators Unary Ternary 3

June 16, 2020

• Arithmetic operators Operations Addition 3


Subtraction - Multiplication * Division Modulus % •
Relational operators Operator Logical operators
Operator Bitwise operators Operator & Operator + /
Meaning < Lesser than <= Less than or equal to >
Greater than >= Greater than or equal to == Equal to
!= Not equal to • Meaning && Logical AND || Logical
OR ! Logical NOT • Meaning Bitwise AND | Bitwise OR
^ Exclusive –OR (XOR) ~ 1's complement << Left
shifting of bits >> Right shifting of bits

June 16, 2020

Arithmetic 4

June 16, 2020

Bitwise 4

June 16, 2020

Shorthand operators Operator Example Equivalent 5


construct + a=a+b a-H=b - a=a-b a –= >k a=a *b a
*=b / a=a/b a/=b a=a"6b a% =b a=a&b a&=b a=a |
b a |=b a=a^b a’ = a=a&b a=a_2 >b Mathematical
Functions Function Description sqrt (x) Return the
square root of x

June 16, 2020

exp(x) Return exponential (e”) log (x) Return natural 5


logarithm of x (base e) log10 (x) Return logarithm of
x (base 10)

June 16, 2020


fabs(x) absolute value of x abs(x) floor(x) Return a 6
value rounded to the next lower integer pow(x,y)
Return x raised to power y (xy) fmod(x,y) Return
floating-point remainder of x/y

June 16, 2020

(with same sign of x) sin(x) Return the sine of x 6


cos(x) Return the cosine of x tan(x) Return the
tangent of x acos(x) Return arc cosine of x [cos-1(x)]
asin(x) Return arc sine of x [sin-1(x)] atan(x) Return
arc tangent of x [tan-1(x)]

June 16, 2020

C Header files Header file Description stdio.h 7


Input/Output functions conio.h Console Input/Output
functions stdlib.h Some standard library functions
math.h Mathematical functions string.h String
manipulation functions ctype.h Character handling
functions time.h Time computing functions malloc.h
Memory allocation / deallocation functions graphics.h
Graphical functions dos.h Function linking DOS
routines wctype.h Functions to classify and transform
individual wide characters limits.h Functions define
various symbolic names float.h Functions define set of
various platform-dependent constants related to
floating point values. Preprocessor Directives
Preprocessor directive Use #define To define a macro

June 16, 2020

#include Inserts a particular header from another file. 7


#if To test whether a compile –time condition is true
#undef To undefine a macro #else To specify the
alternative action if a test fails
June 16, 2020

#endif To end the preprocessor condition 8


Development of C Program: Source Code
preprocessor compiler linker Executable program
Basic structure of C Program library

June 16, 2020

preprocessor statements global declaration; main() 8


{ declarations; statements; } user defined function

June 16, 2020

ASCII Table ASCII 10 11 12 13 14 15 16 17 18 19 20 9


21 22 23 24 25 26 27 28 29 30 31 Char NUL (null)
SOH (start of heading) STX (start of text) ETX (end of
text) EOT (end of transmission) ENQ (enquiry) ACK
(acknowledge) BEL (bell) BS (backspace) TAB
(horizontal tab) LF (NL line feed, new line) VT
(vertical tab) FF (NP form feed, new page) CR
(carriage return) SO (shift out) SI (shift in) DLE (data
link escape) DC1 (device control 1) DC2 (device
control 2) DC3 (device control 3) DC4 (device control
4) NAK (negative acknowledge) SYN (synchronous
idle) ETB (end of trans. block) CAN (cancel) EM (end
of medium) SUB (substitute) ESC (escape) FS (file
separator) GS (group separator) RS (record
separator) US (unit separator) ASCII 32 33 34 35 36
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
54 55 56 57 58 59 60 61 62 63 ? > = < ; : 9 8 7 6 5
4 3 2 1 0 / . - , + * ) ( ' & $ # " ! SPACE Char %
ASCII Char 64 65 66 67 68 69 70 71 72 73 74 75 76
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
94 95 _ ^ ] \ [ Z Y X W V U T S R Q P O N M L K J I H
G F E D C 99 c 4 B 98 b 3 A 97 a 2 @ 96 ` 1 ASCII
100 101 102 103 104 105 106 107 108 109 110 111
112 113 114 115 116 117 118 119 120 121 122 123
124 125 126 127 ~ } | { z y x w v u t

June 16, 2020

Data Conversion Functions Function Use atof() 10


Converts string to float atoi() Converts string to int
atol() Converts string to long ecvt() Converts double
to string fcvt() Converts double to string gcvt()
Converts double to string itoa() Converts int to string
ltoa() Converts long to string strtod() Converts string
to double strtol() Converts string to long integer
strtoul() Converts string to an unsigned long integer
ultoa() Converts unsigned long to string Character
Classification Functions Function Use isalnum() Tests
for alphanumeric character

June 16, 2020

isalpha() Tests for alphabetic character isdigit() Tests 10


for decimal digit islower() Tests for lowercase
character isspace() Tests for white space character
isupper() Tests for uppercase character isxdigit()
Tests for hexadecimal digit tolower() Tests character
and converts to lowercase if uppercase toupper()
Tests character and converts to uppercase if
lowercase

June 16, 2020

Вам также может понравиться