C Language IN Hindi - Lecture notes 1-55 PDF

Title C Language IN Hindi - Lecture notes 1-55
Author Ashutosh Chaturvedi
Course Bachelor of computer application
Institution Indira Gandhi National Open University
Pages 115
File Size 3.5 MB
File Type PDF
Total Downloads 68
Total Views 152

Summary

fioauf dfueibd fajdfkaje dfas...


Description

Modern Programming Language which is used mostly for Professional Application Software development like Java or C#. So, learn “C” and start moving in the way of Professional Development for full of Joy and Healthy Programming Career.

฀฀฀ Kuldeep Chand BetaLab Computer Center Falna 1 Any Question or Suggestion, Click Here to Discuss

C in Hindi Programming Language “C” in HINDI Copyright © 2011 by Kuldeep Chand All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Lead Editors: Kuldeep Chand Distributed to the book trade worldwide by Betalab Computer Center, Behind of Vidhya Jyoti School, Falna Station Dist. Pali (Raj.) Pin 306116 e-mail [email protected], or visit http://www.bccfalna.com For information on translations, please contact BetaLab Computer Center, Behind of Vidhya Jyoti School, Falna Station Dist. Pali (Raj.) Pin 306116 Phone 097994-55505 The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, the author shall not have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this book.

2 Any Question or Suggestion, Click Here to Discuss

C in Hindi

This book is dedicated to those who really wants to be a

Professio ProfessionA nA nAl l develoPer

3 Any Question or Suggestion, Click Here to Discuss

C in Hindi

index of Contents

4 Any Question or Suggestion, Click Here to Discuss

C in Hindi Table of Contents Introduction ............................................................................................................... 12 Data – Value or a Set of Values ............................................................................ 12 Processing – Generating Results .......................................................................... 13 Information – Processed Data ............................................................................... 13 What is a Computer ............................................................................................... 14 System – Group of Units to Solve a Problem ........................................................ 14 Program and Software........................................................................................... 14 System Software: ............................................................................................... 15 Application Software: ......................................................................................... 15 Computer Architecture........................................................................................... 15 I/O Devices ........................................................................................................ 16 Center Processing Unit (CPU) ........................................................................... 16 Memory .............................................................................................................. 17 Types of Programming .......................................................................................... 17 Hardware Programming ..................................................................................... 18 Software Programming ...................................................................................... 18 Language Introduction .............................................................................................. 20 Level of Computer Languages .............................................................................. 20 Low Level Language or Machine Language ...................................................... 20 Middle Level or Assembly Language ................................................................. 20 High Level Language ......................................................................................... 20 Assembler .............................................................................................................. 21 Compiler and Interpreter ........................................................................................ 21 Similarities between Real Word and Computer Program ...................................... 21 Steps of Program ............................................................................................... 22 Characteristics of a Good Program ....................................................................... 23 Problem – Doing Something.................................................................................. 23 Algorithm – List of Sequential Steps to Solve a Problem ...................................... 24 History of Programming Language “C” .................................................................. 25 Characteristics of “C” ............................................................................................. 25 Layout Structure of “C” Programs ...................................................................... 26 Coding Structure of “C” Programs ..................................................................... 27 Functions – Pre-Defined and User-Defined........................................................... 30 Input Section ...................................................................................................... 31 Process Section ................................................................................................. 32 Output Section ................................................................................................... 32 Output Function ..................................................................................................... 32 Basic Elements of “C” ............................................................................................... 38 “C” Characterset .................................................................................................... 38 “C” Tokens ............................................................................................................. 38 Keywords ;k Reserve Words .............................................................................. 39 Identifiers – Constant and Variable Name ......................................................... 39 Constants and Variables .................................................................................... 41 Identifier Declaration .......................................................................................... 44 Data and Data Types ............................................................................................. 47 Integer ................................................................................................................ 48 Float ................................................................................................................... 51 Double................................................................................................................ 51 Character ........................................................................................................... 52 Data Types Modifiers ......................................................................................... 53

5 Any Question or Suggestion, Click Here to Discuss

C in Hindi Control String ..................................................................................................... 54 Preprocessor Directive....................................................................................... 58 Literal ................................................................................................................. 63 Types of Instructions ........................................................................................... 111 Type Declaration Instruction ............................................................................ 111 Arithmetical Instruction..................................................................................... 112 Control Instruction ............................................................................................ 115 Precedence of Operators .................................................................................... 116 Type Conversion in Expressions ......................................................................... 118 Automatic Type Conversion ............................................................................. 119 Manual Type Conversion OR Casting ............................................................. 119 Function Calling and Function Arguments ........................................................... 121 String and Character Functions ........................................................................... 122 Working with String .......................................................................................... 122 Working with Characters .................................................................................. 128 Formatted Input ................................................................................................ 132 Formatted Output ............................................................................................. 136 Control Statement and Looping .............................................................................. 146 Program Control .................................................................................................. 146 Types Of Control Statement ................................................................................ 146 Sequential Statements ..................................................................................... 146 Conditional Statements .................................................................................... 147 Iterative Statements ......................................................................................... 147 Compound Statement or Statement Block .......................................................... 148 if statement .......................................................................................................... 148 if – else statement ............................................................................................... 151 Nested if else statement ...................................................................................... 153 if – else if – else Ladder statement ...................................................................... 157 switch statement .................................................................................................. 160 goto Statement .................................................................................................... 163 Looping Statements ............................................................................................. 166 for Loop ............................................................................................................ 166 Nesting of Loop ................................................................................................ 174 while Loop ........................................................................................................ 178 Do…while Loop................................................................................................ 181 break Statement .................................................................................................. 182 continue Statement .............................................................................................. 182 Arrays ...................................................................................................................... 190 Linear Arrays ....................................................................................................... 193 2-D Array ............................................................................................................. 200 Initializing Value of a Character Array (String) .................................................... 202 Functions ................................................................................................................. 208 Library Functions ................................................................................................. 208 User Defined Functions ....................................................................................... 208 Calling Function and Called Function .................................................................. 209 Function Definition ............................................................................................... 209 Argument Variables Declaration .......................................................................... 210 Local Variables ................................................................................................ 210 Return ( Expression ) ....................................................................................... 210 Statement Block ............................................................................................... 210 Function Prototype ........................................................................................... 210 Types of Functions .............................................................................................. 211

6 Any Question or Suggestion, Click Here to Discuss

C in Hindi Function Without Argument And Return Value ................................................ 211 Function With Argument But No Return Value ................................................ 215 Function With Argument And Return Value ..................................................... 221 Function Without Argument But Return Value ................................................. 224 Recursion and Recursive Function...................................................................... 225 Storage Classes .................................................................................................. 229 Type of Variables In Program .......................................................................... 229 Automatic Storage Class ................................................................................. 231 Extern Storage Class ....................................................................................... 234 Static Storage Class ........................................................................................ 236 Register Storage Class .................................................................................... 237 Pointers ................................................................................................................... 240 Understanding Pointers ....................................................................................... 241 Defining Pointers ................................................................................................. 242 Accessing the Address of the Variable ................................................................ 243 Accessing a Address Through It’s Pointer ........................................................... 244 Pointer Expressions ............................................................................................. 246 Addition and Subtraction A Number to a Pointer ............................................. 247 Pointer Increment and Scale Factor ................................................................ 247 Function with Arrays ............................................................................................ 249 strcat() Function ............................................................................................... 251 strcpy() Function .............................................................................................. 253 strlen() Function ............................................................................................... 253 strcom() Function ............................................................................................. 254 Working with Binary Digits ................................................................................... 255 Subtraction One Pointer to another Pointer ......................................................... 258 Comparison of two Pointers ................................................................................ 258 Array in Function through Pointer ........................................................................ 259 Function Returning Pointers ................................................................................ 261 One – Dimensional Array with Pointer................................................................. 262 Pointer with 2-Dimensional Array ........................................................................ 266 Array of Pointers .................................................................................................. 269 Array of Pointers To String .................................................................................. 271 C Preprocessor ....................................................................................................... 284 Directives ............................................................................................................. 284 Macro Substitution Directive ............................................................................ 285 File Inclusion Directive......................................................................................... 291 Conditional Compilations ..................................................................................... 292 Function And Macros ........................................................................................... 296 Build Process ....................................................................................................... 297 Dynamic Memory Allocation.................................................................................... 299 malloc() Function ................................................................................................. 300 calloc ( ) Function ................................................................................................ 303 free() Function ..................................................................................................... 304 realloc() Function ................................................................................................. 305 Structure.................................................................................................................. 308 Structure Definition .............................................................................................. 308 Structure Declaration ........................................................................................... 309 Accessing the Structure Members ....................................................................... 310 Initializing the Structure Members ....................................................................... 311 Structure with Array ............................................................................................. 311 Array within Structure .......................................................................................... 314

7 Any Question or Suggestion, Click Here to Discuss

C in Hindi Structure Within Structure ( Nested Structure ) ................................................... 315 Structure with Function ........................................................................................ 320 Union ................................................................................................................... 325 Pointers and Structure ................................................


Similar Free PDFs