Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
5 views
C Programming Notes Part 4
c programming notes mechanical engineering semester 1 part 4
Uploaded by
Farhan Masud
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save C-Programming-Notes-Part-4 For Later
Download
Save
Save C-Programming-Notes-Part-4 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
5 views
C Programming Notes Part 4
c programming notes mechanical engineering semester 1 part 4
Uploaded by
Farhan Masud
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save C-Programming-Notes-Part-4 For Later
Carousel Previous
Carousel Next
Save
Save C-Programming-Notes-Part-4 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 16
Search
Fullscreen
“main () chat namel J = “program” 5 while Cname Li]4= ‘\o') — betavse all strings have a null Wye haracte O at the end. If printeC'%e"namel id); itty i jain o) {chav name Tt I=“ program”; char *p5 PS a Tame|-s base address. baname, — Leemel while C*¥p!=‘\o") schan type van (no address) PAGE CHa NP) “emty mention base | Pts address for chan | 3 Natiable pointers. @ becavse we are pointing the Memony address [The memony addness 1S ‘shifting to the sight llana p points the value lat that memony addvess | each +me.|) main ©) string print? ("% 5" name); main ( ) [char namel J; scanf C" %8", & name ); print C'%", name) Lcharnamel I=" program” ; fon string, the sean? operator will constantly p Input Chanacters until “enter” is pressed, ogets (wanks os scant subshtute) Ly puts (mks as printf subshtute)sent on element in ay f witite a phegham in c I anteay. Ft indude
int main C) Lint afacl.n,i, pos, sah print( C" Enter the nov of elements in the atnay: seanf (°24", BPD} printf (" Enter the Value of each element: \n)5 for Cis 0; init) % scant (°Z4") & atid); k prints ("0") fprins? ("The elements ave: An")5 fos Cizo5 iS 44) y printe CUZ NE “atid, } printf C Enler the position where You wil) insenk an element: \n ")) ccant ('7%8", BROS);printf C’ Enter the value: \n")5 secant (124%, Bvt; for for G nj iyeoyin-) Lp for (ie nya 1X03 i--) fox (ie nas >= pesnad 5 1-~) I, eee atideoli-353 let is a[posn =] =val > for Ci=Oy ic=ns ind g printf ("% a \esatids 3 3x eo Write an element nc fo teverse an || & aray. || #inctude
meains i is Pointing on a chanacteh type variable, chan styl 2 Heng? chan sty Cio] ; chan %» Hettos chan kq », 425; j ster = shel) X aHinclude
: Pinchade Cofd lib-hD actual dtegoment 7 main () in) main fonch'on - int So email at genint int lend 5 in osery definsd foncho chat ova Y=“ cycle"; ark | (NT = x strien Cactend> PRIMEE C" The length is %d" ent)3 | 3 RstttenCitent Merete For string, address opera tp | XStrelen (#p) “R) not needed TURP = stien (ara), } dtwhay declared int main€ ) string assigned chan ana T Je" Bamboo bed", int jents (2 4ehual on gument lent = x stylen( ara); PrIDLEC'\9 sheings 7s and length =%24 ara, tent)! [| | xotnten Cehar * 5) Vlength 445 Sts 3 lt int length =0 5 : turn Clength) 5 white (4 *5=\0)4 int seottrco py G8) (char *8) vinifaitig int by : {tox white Cs 1-0") Lis an emply ‘aivkay oF ple «string. | xsttecepy (chan #E, chads) change With cat) by _ permanent change. { white (*s!=0) address - per Lets ts, change with cat! by function: oti change is localised- Ly Mere} dbz; t LoJ=slol tfoJ=s Hconslant Ssource is fixed > the steing wit not change then. chan ®p= Hello’; constantcharr *q 5 kg eeu): ape oM's * : *q<'Bye’ string is fixed, not pointer.3 | chan tager P30] = “teito”5 Il cineat (source, targeb); | Prinl# C" faxgeh ghuing © 7-8") seumtanget 3 printt ("source steing = %s", tare souh 5 | Witite a Catenation. int mann C) Lchan souneel J=" Fox *5 Progam jn C vsing a vsendefined Function hat wit do the same Function 03, string(a7 69/19 int main © ) Lo schar string sil ]<" Jerry”s char string 212" Ferry’ int i,3,k3 je stremp Coting1, “Jeary” 5 d= stremp (string 1, string ads k = stremp( string 1, “ Jerry bey D5 printf (S#\n 4d %S wa aks J define FOUND J . 4 define =symbolic constant dedefine NOT FOUND O * maint) Speherint JL char sist Le Tte] ={“Akshany”, “Ponny > “Roman”, “omimive s, * Gopal”, “pajath", S[iJ[oJ > base addizess ‘ a : Cfiirst letter ony) S | int i,Flag, a; char yourname [10]; scant ("7% Ry ounname); _ Flag = Nor Food; | for (iz os i<=8y i +4) { asstremp(& list CATO) younname) ; if (a==0) Print f C” weteome.”); flag= = Founn, break, j } 2 if (flag == nworFounp) & printf (" Sotary.")5 5 Discuss about oteing comparison. white down a program to chow the application of string companison 1 = : char *tist0 J={ | This can be done with pointers imain ( ) (ENET TS Tesnan ¥ L chan namest JL Jt" Robin's Parag"; * Raman” " srinivas’, } ant id char bt; Printf C"\nze%s", Rnomel2ifols & names t®Jfo]); for Ciz05 idsay ite) Lt = namesattils names Caq[iJ = names (3Jti] 5 names C3]CiT=t, F % print eC" 75°75", & names taWoJ& names CaILel); 3maine ) " Parag": “Roman” “ sranivas “5, * char “temp 5 Prine C“ \n vs 78", names 27, namesE3I)5 Femp = nameslads names E2]= names 375 Names T31 = temp, printf ("Xs %e%) nameL2I, name t3])3 iStreueturce Svairiable af a fimeyuse many datatypes > declame “cha in tegen sete types of variables at bnce main C ) 1 {chav name C935 Float price L5)5 sre pages int papers [ 31,3), for (j= 0; i¢= as ire) Lscanf (Le Zp 4a", & hameLiT, &priceLil, & paper Ci] )5;} maint) { siruct ook 1 Q0/ Jo 12019main ©) Ne gate hewiy |] { chav name ; float price; int pages; Struct book bysbesbs5} of |: sem ta mid Seank ("Ze uF ZI", Ebi name, Rbj price & bipages), | scant ("Ze LF ZA", Rbdname, &b2 price, Rbrpages); _ Sank ("ZACZF ZA", Rbaname, RbIprice, & pSpages); fei printf ("Ze ZfZd5 biname, bipages, bi pages); Print C"ZE ZF Za", ba-name, br price, ba pages)s printf ("ZC ZF Za", baname, b3 price, b3 pages); retirn 0; | 3 values, | ARRay: Many variables of some data type | in one vertiabi Ghructite: ts handle different datu types. Why Is strwetune impon font C-peegtammi ng, ~> point fotrm 5 definition —> example (MvsT)| Te types of constants : | > numerricar constant > string constant: “Operators: Arithmatic operator, assignmend operatos ett Heiss fox, if else,do while, else if, go to study I+ go to se examples | | + continue statement s Flow chart sawteay (1p, 20,38) —> how they aire sized in the mMemery, || ~Dvenite = insert + find the min. element of || | «delete an atikay | annay | + add - find the |posn of min. element fre Verse || >write a progam to fink odd =matices. > pyteamid preegicam Ly ohudy the series of sin, €05, e™ ete. is Pyramid | Preegtam * AND > ee 7 ‘ a a3 Se aig eS TF “ 23
You might also like
Complete C Slides
PDF
94% (18)
Complete C Slides
152 pages
Strings
PDF
No ratings yet
Strings
25 pages
Module 5
PDF
No ratings yet
Module 5
36 pages
Strings
PDF
No ratings yet
Strings
19 pages
Unit 3 (PSTC)
PDF
No ratings yet
Unit 3 (PSTC)
14 pages
Strings
PDF
No ratings yet
Strings
28 pages
ESC-M5
PDF
No ratings yet
ESC-M5
22 pages
1 To 5 Pps
PDF
No ratings yet
1 To 5 Pps
12 pages
Lect Strings
PDF
No ratings yet
Lect Strings
30 pages
L4-Array and String
PDF
No ratings yet
L4-Array and String
31 pages
11
PDF
No ratings yet
11
31 pages
C Programming Notes Part 3
PDF
No ratings yet
C Programming Notes Part 3
24 pages
Cprogramming ICTweek 4
PDF
No ratings yet
Cprogramming ICTweek 4
31 pages
17-Strings
PDF
No ratings yet
17-Strings
19 pages
Raport Lab 6
PDF
No ratings yet
Raport Lab 6
7 pages
Unit 3 Strings
PDF
No ratings yet
Unit 3 Strings
39 pages
CS 116 Lecture 14 - Short
PDF
No ratings yet
CS 116 Lecture 14 - Short
27 pages
C Language Notes-2
PDF
No ratings yet
C Language Notes-2
40 pages
String in C
PDF
No ratings yet
String in C
9 pages
07 Strings
PDF
No ratings yet
07 Strings
20 pages
.Dsa 3 Lab Assignment
PDF
No ratings yet
.Dsa 3 Lab Assignment
36 pages
Character Array and Strings
PDF
No ratings yet
Character Array and Strings
33 pages
CPU Part 2
PDF
No ratings yet
CPU Part 2
143 pages
Tin Hoc Co So 2 Week4 Hust
PDF
No ratings yet
Tin Hoc Co So 2 Week4 Hust
51 pages
c programming
PDF
No ratings yet
c programming
172 pages
Chapter 7.2
PDF
No ratings yet
Chapter 7.2
23 pages
Sodapdf
PDF
No ratings yet
Sodapdf
23 pages
Computer Programming Basics
PDF
No ratings yet
Computer Programming Basics
25 pages
Pointers for straing manupulation programs
PDF
No ratings yet
Pointers for straing manupulation programs
8 pages
3 String
PDF
No ratings yet
3 String
44 pages
String in C Language
PDF
100% (1)
String in C Language
27 pages
Strings Final
PDF
No ratings yet
Strings Final
57 pages
Vignan CP UNIT-4 Strings
PDF
No ratings yet
Vignan CP UNIT-4 Strings
33 pages
String Assignment
PDF
No ratings yet
String Assignment
18 pages
Computer Programming For Engineers: NAOE 2214
PDF
No ratings yet
Computer Programming For Engineers: NAOE 2214
32 pages
PPS Lab Manual (Exp6-10)
PDF
No ratings yet
PPS Lab Manual (Exp6-10)
24 pages
Strings: #Include #Include
PDF
No ratings yet
Strings: #Include #Include
12 pages
Array String
PDF
No ratings yet
Array String
19 pages
Module-4
PDF
No ratings yet
Module-4
118 pages
FOC Unit 3 slides
PDF
No ratings yet
FOC Unit 3 slides
30 pages
C Programming Unit - 9 Part II Strings
PDF
No ratings yet
C Programming Unit - 9 Part II Strings
54 pages
Lab12 Strings
PDF
No ratings yet
Lab12 Strings
4 pages
ICP-PART-8
PDF
No ratings yet
ICP-PART-8
146 pages
Character Arrays and Strings: Department of Computer Science and Engineering
PDF
No ratings yet
Character Arrays and Strings: Department of Computer Science and Engineering
62 pages
12 Strings
PDF
No ratings yet
12 Strings
13 pages
CP Important Question Bank Which Can Come
PDF
No ratings yet
CP Important Question Bank Which Can Come
32 pages
String
PDF
No ratings yet
String
48 pages
Strings: - A String Is A Sequence of Characters Treated As A Group - We Have Already Used Some String Literals
PDF
No ratings yet
Strings: - A String Is A Sequence of Characters Treated As A Group - We Have Already Used Some String Literals
48 pages
String
PDF
No ratings yet
String
11 pages
Unit 2
PDF
No ratings yet
Unit 2
41 pages
Module4 Notes
PDF
No ratings yet
Module4 Notes
10 pages
PPS SOLVED Previous Years Questions PDF
PDF
No ratings yet
PPS SOLVED Previous Years Questions PDF
19 pages
FDSDFSD
PDF
No ratings yet
FDSDFSD
31 pages
UNIT4 String
PDF
No ratings yet
UNIT4 String
29 pages
PIC_Exp5 (1) (1)
PDF
No ratings yet
PIC_Exp5 (1) (1)
7 pages
2 String
PDF
No ratings yet
2 String
5 pages
Basic I/O - Scanf : CSCI 230
PDF
No ratings yet
Basic I/O - Scanf : CSCI 230
10 pages
POP Module 4
PDF
No ratings yet
POP Module 4
29 pages
C Slides
PDF
No ratings yet
C Slides
151 pages
Exp 01
PDF
No ratings yet
Exp 01
4 pages
C Programming Notes Part 1
PDF
No ratings yet
C Programming Notes Part 1
24 pages
C Programming Notes Part 2
PDF
No ratings yet
C Programming Notes Part 2
24 pages
Maths ODE Part 1
PDF
No ratings yet
Maths ODE Part 1
24 pages