C Language.doc

August 23, 2017 | Author: కిరణ్ కుమార్ జి | Category: N/A
Share Embed Donate


Short Description

C Language in telugu...

Description

1.

About C Language ఒక

(







క) క

. క

. క ఒక

-



.



.

  

++



.

'C' language:

Friends 'C' language క

language

Friend's "

Easy programing language .'C' language Dennis Ritchie

1970

Bell Telephone

'C' language

"

(flowchart)"

2.

( ALGORITHM ) (ALGORITHM):

ఒక క

ఒక క



"

" (

ఒక general-purpose

)

"

ఒక

ఒక క "

"

ఏ programing language (algorithm)



Base ఏ



(algorithm) (algorithm) క







క . Language Programining language

(example:c,c++,java..) Example: ఒక Problem





Problem1: Number

add

(a=2 b=3 c=a+b) ?

solution:

step1: start step2:

(a=2)

step3:

(b=3)

step4:

nembers add

step5: step6: IN ENGLISH

print / display add end

add=a+b

step1: start step2: read first number(a=2) step3: read second number(b=3) step4: add above two number i.e add=a+b step5: diplay / print add step6: end : ఏ

start problem1

steps

step1

start

Slove

Problem



.

.

Ending క

start

last step(step6)

.

.

End

problem 2: క

Numbers

a=2 b=3

(find the biggest number from the given two numbrs a=2 b=3) solution:

step1: Start step2: step3:

a=2 b=3

step4:

a>b

step5: correct step6: correct step7:

a క

print

b

print

end

IN ENGLISH step1: Start step2: Read a=2 step3: Read b=3 step4: if a>b = true then step5: display a is big go to step7

step6: else display b is big step7:end : ఏ

start

problem1

step1

start

Reading numbers. a>b .

correct

decide end

next step5



decide

step2 & step3 numbers a

step6

. a>b correct b

.

step

.

.

step5



step7 క

step6

3.

(FLOW CHAT) (FLOW CHAT): క



క .



(flowgraph)

boxes

symbols

(operation)box boxes

symbols .ఈ

క క

arrow

Arrow connect

. connect algorithm

figure క

symbols and boxes

(flow chat )

Examples

Example: Problem 1: Number

add

(a=2 b=3 c=a+b) ?

Flow Chat (Draw a Flow Chat Diagram For Addition Of Two Numbers) solution1:



:

problem1 .

start step1

start

2 & 3 steps

5 th steps

క ఏ

.

4 step

output

[Rectangle] print

[parallelogram] start

oval క



perform .



.

values

[parallelogram] addition

.

Ending క

. .

last step

(step6)



End

oval

problem 2:



Numbers

a=2 b=3 .

Flow Chat

(find the biggest number from the given two numbrs a=2 b=3) solution1:

:



problem1 .

start step1

2 & 3 steps

క step

start



.

oval

values input [parallelogram]

condition

.

check

. క

4 A

B

క Diamond

CHECK 6 th steps

output

Ending క

start



. .



End



print

[parallelogram]

.

last step (step7)

oval

4.

( Examples on Algorithm )

Example 1: ఒక (1) N



Number

add

?

(write an algorith for adding number from 1 to N?)

solution:

step1: start క

step2:ఒక step3: step4:

ఒక

add క

add

క SUM=0

CONDITION CHECK

GOTO STEP 5



GOTO STEP 7.

step5: SUM=SUM+N step 6: N=N-1 GOTO step 4. step7:Display SUM step8:

N

end

IF ( N != 0)

IN ENGLISH

step1: start step2:Read N; (N is the value up to we can add) step3:we want add values from 1 to N so take SUM=0; step4:Now we want check condition IF ( N != 0) Then GOTO STEP 5

if else

GOTO STEP 7.

step5: SUM=SUM+N step 6: N=N-1 GOTO step 4. step7:Display SUM step8: end : ఏ

start

step1

start

.step2

add

క add క

next 1 value SUM 0

example N



step 5

3

N=N-1

GOTO STEP 4

N

0 క

SUM

value





0

3 ( SUM=0+3).

( N =3-1) . .

.

.

SUM=SUM+N

SUM 2



condition N!=0 check

NEXT STEP

STEP 4

N

.NEXT STEP

step 7 now Step 4

N

1



1

3!=0 CORRECT

PERFORM STEP 6





N =3

problem1

problem

step 2

N

.

STEP4

CONDITION

CHECK

NEXT STEP

STEP 6 SUM

STEP 4 VALUE

PERFORM

N

0 AYE

. క

N =0

step 7

Dispaly

5.

Examples on Flowchart

Example 1: ఒక (1)

LOOPING

N



Number

add

?

(write an algorith for adding number from 1 to N?) Solution :

.

: ఏ step1

start start

add

.step2

N

క add క

0



step 5

క N

problem

problem

step 2

next 1 value SUM

.

1 0

Arrow

1

N

value





క .

.NEXT STEP step 7



.

example N



N =3 3



3!=0 CORRECT

PERFORM STEP 6

Arrow

SUM N

GOTO STEP 4 CHECK

SUM 2

STEP 6

Arrow

step 7

PERFORM STEP 4

6..

3 ( SUM=0+3).

STEP 4

SUM

SUM=SUM+N

( N =3-1) .

Arrow NEXT STEP

condition N!=0 check NEXT STEP

0

N=N-1

Arrow

now Step 4

. .

N

LOOPING క

0

VALUE



STEP4

. N =0

Dispaly

( C language Introduction ) క

C Language





data

. క



(or ) ఏ

( key )

క )

(

)

.ఈ access



.

Language's

3

:

Low Level Language: క



.



0 , 1 .





ఒక

.

), 1 (ఒక )

.ఈ

(Memory location Address )



1.

( data )

(క

. ఒక

)ఏ

(



0 (

Low Level Language ఏ

.

.

క 0, 1



.ఈ ,ఒక క

. :







0001 0111 0100 ఈ Low Level Language క 2.





. క

Middle Level Language : Middle level languages

programs

MOV ADD SUB DIV క

Direct ఈ



language









.





/ . ఈ language

High level language



GENERAL

programs (C , C++,

computer

High

.

.క

క languages

Machine level



.

High level language :

JAVA ... )

ఒక

programs computer

low level



3.

, Registers





.

computer



. computer programming Low

.క

Compiler/ Interpreter

( MACHINE LEVEL LANGUAGE / LOW LEVEL LANGUAGE/ BINARY LEVEL LANGUAGE )



.

"C" Language

Program

Low level

"C"

Language

. ఈ Compiler

ALT+F9 Press Create

. ఈ File

Program

Output

High

Level

Low level

Low Level క

.

.

Program

Compiler

High Level Language

Ctrl+F9

Press

Level

Program .

Program

Low

FileName .Obj క

Folder

Output

. Program Extra .

File



:



:

7.

First Program In C ఏ Programming language

Program

ఒక 

C Language

Write a Algorithm To print a message "HELLO WORLD "?

STEP1: Start Step2:

print HELLOWORLD

STEP3: END Same 

"C " Write a Program to print Hello world message At output ?

#include < stdio.h > void main() { printf(" Hello world "); } Starting step "start " క main().

STEP2 print HELLO WORLD

printf(" hello world "); Use } use

"C " Language

.



STEP3 End

Stating Step Void "C " Language క

.

printf syntax: printf (" ఈ

's

output

Examples On printf : 

printf(" hai ") ; -----------------> hai

output

");

Ending

.



printf(" siva naadh baazi is great "); --------------------> sivanaadh baazi is

output 

printf("your name");----------------------> your name

" Printf work

printf

program already stdio.h ఈ file

void main() ఈ program

#include

program program

compilation

printf

compilation

Press

Errors

Output

0

Program .

Output

ALT+F5 press

. .

CTRL+F9 press

Output

OUTPUT

program

ALT+F9

Error's

Output

CTRL+F9 PRESS

include

"

Include

compile

ERRORS

output

OUTPUT

.

output

.

Output

picture

pro1

ok

.



. ఈ output

. Picture

PROGRAM

compile .

Execute

output

pro2

OUTPUT Program

Hello world Hello world

Hello world

print ఒ

printf

.

. ఒ

.

output ఒ

First Hello world Output

Output. Output

print

Program Output. .

previous program output statement

clrscr() -------->

program

Hello world

program Output

" clrscr() "

print

clear screen

clrscr() work

present program output clear

.

. meaning

program

Include

.

program "

conio.h " . Ctrl+F9 Press . Output screen

ఒ statement

Ending Bracket

Output Ctrl+f9 press

.

output Screen " getch () "

getch () ------>

Get character

meaning

Output Screen

key press

. getch () ------> work

program

Include

.

program " conio.h " .

Final

Program



#include < stdio.h > #include < conio.h > void main() { clrscr(); printf(" Hello world "); getch(); }

output

output



print

......

8.

C Programing Rules Rules

.

English

Grammer

" C " Language Rules

.

C Language Rules : 1.

"C"

Progarm

Starting

point

main()

Function

Note: main()

#include

(

Functions

program

)

Only

Work

.

Example

: printf(""); program Stdio.h

stdio.h 2.

include

program Starting Point

main() function

.( English

vundhi printf work main()

statement SEMI COLON ;

ఒక sentence End

full stop . ఏ



END

semicolon

) 3.

main() Function

Begining Bracket and Ending Bracket

ea statements ina 4.

.

.

main() Function

#include statements

Header files

.



5.

Program

Example:

filename

.(dot)c

save

program1.c pro.c abcdfeg.c

6.

Progarm Run

Complie CTRL+౯ ( Output

ALT+F9 )

-----------------9.Printf



Write A Program To Print Your Name and Age At Output

#include #include

void main() { clrscr();

printf("sivanaadh baazi"); printf("22"); getch(); }

output ఈ sivanaadhbaazi 22 output ఒ



output

.

output



(

)

ఒ printf statement

.

.

..

#include #include void main() { clrscr(); printf("sivanaadh baazi 22"); getch(); }



output







ఒ .

same

. ...

" C Language " ..



Printf Statement

\n --ఒ 

(New Line ) ఒ

Write A program To print Your Name And Age Line By Line..

\n (New line) Statement

1st printf Statement

output

1st printf



ఒ ఒ printf statement

\n ( New Line )

new line

( \n )



\n



\n ( New Line )

Examples Printf

output

ఈ output

. \n ( New Line )

..

printf statement output

..............



Write a Program To print U R Bio-Data at output

#include #include void main() { clrscr(); printf("name=sivanaadh baazi"); printf("age=22"); printf("gender=male"); printf("father name=satyanarayana"); printf("mother name= malleswari"); printf("qualification=BTech");

getch(); }



Output ఈ

output: name=sivanaadh baazi age=22 gender=male father name=satyanarayana mother name=malleswari qualification=BTech ఒ



#include #include void main() {

\n ( New line )

.

clrscr();

printf("name=sivanaadh baazi \n"); printf("age=22"); printf("gender=male \n "); printf("father name=satyanarayana"); printf("mother name= malleswari \n"); printf("qualification=BTech"); getch(); }

New line ( \n )

1,3,5 printf statements

Ouput: name=sivanaadh baazi age=22 gender=male father name=satyanarayana mothername=malleswari qualification=BTech

printf statement

New Line

...............

:) :) :)

10.Printf

continue Character

Escape Sequence

Newline

\n

Horizontal tab

\t



Vertical tab

\v

Backspace

\b

Carriage return

\r

Alert

\a

Backslash

\\

Question mark

\?

Single quotation mark

\'

Double quotation mark

\"



printf క

. ఈ







\n

.. \n

.

Escape Sequence

.

table



.

Horizontal Tab ( \t ) : క

printf .

Program on Horizontal Tab :

\n \t

ఒక

(space )

.

Output :

C Language Show videos in youtube link: http://www.youtube.com/watch?v=RPJx7mCYXzU&playnext=1&list=PLA8E0AD777C0B9827&feature=re sults_main

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF