Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
 Consists of a set of predefined rules.
 These rules form the syntax of that language.
 Hence learning a programming la...
 Computer can understand only instructions written
in binary code ( 0 and 1), They do not directly read
or understand a a...
 C is a programming language developed at
AT&T Bell laboratories around 1972.
 It was designed and written by Dennis M.
...
 Flow chart
use to define flow of any program.
symbolic representation of program.
use different symbols.
 Rectangle
 Parallelogram
 Diamond
 Lines
 oval
 Use to define process in program
 Use to define input and output in program
 Use to specify condition in program
 To show flow of the program
 Use to declare start and end of flow chart and
connect flow chart with other flow chart
pages also.
start
end
Input
outputoutput
conditionProcess if
true
Process if
false
start
end
Insert value of i
Print value of I
is less than
five
Print value of
I is greater
than five
If(i<5)
Declare varia...
Documentation
Symbolic Constant Definition
File Include Section
Global Variable Declaration
Main()
{
Declaration
Executabl...
 Compile is one type of program to convert
source code into machine level code,
 Compiler compile the code of block and
...
 #include <stdio.h>
 #include <conio.h>
 void main()
{
printf(“My first program”);
getch();
}
 #include <stdio.h>
 #include <conio.h>
# : is pre possessive directive.
use to include header files before
start the pr...
 Header file is collection of pre define
functions.
 Extension of header file is must “.h”.
 Header files are located i...
 void main()
{
main()
c compile founds main() to start execution of
program.
must declare main function in every program.
 {
 braces use to define starting of coding block.
 printf(“My First program”);
 printf() : use to print any formatted
string in output window of
Turbo c.
header file : st...
 getch();
 }
 getch() use to get 1 character from
keyboard.
} define end of coding block.
 Compile the source code with.
Alt + F9
Run the program with.
Crtl + F9
 C language is totally case sensitive language.
 All the statements of C language must
terminate with semi colon ( ; )
 My First program
file type extension
 C- Source file .C
 application file .EXE
 object file .OBJ
 Comment lines ignore by c compiler
// use for single line comment
/* */ use for multiline comment
 Integer
 Float
 Double
 Character
 Signed integer
range -32,768 to 32,767
occupy first bit as a sigh bit.
( + / - )
memory space ( 2 bytes )
 Unsigned integer
range 0 to 65,535
not occupy any bit as sign bit.
memory space ( 2 bytes )
Note : to declare unsigned i...
 Use to store values with fiction point.
memory space ( 4 bytes) 32 bits
Double 64 bits(8 bytes)
Long double 80 bits(10 b...
 Default unsigned character
 8 bits ( 1 byte )
 Range : 0 to 255
 Signed character
 8 bits ( 1 byte )
 Range : -128 ...
 int a = 10;
 printf(“Value of variable a is : %d”,a);
 o/p : Value of variable a is : 10
 %d use for integer values
 %f use for float values
 %c use for character
 %s use for String
 %l use for double value...
 Use
 scanf() function
 Syntax :
 scanf(“format character ”, &variable name);
 int a;
 printf(“Enter value of a ”);
 scanf(“%d”,&a);
 printf(“Value of variable a is : %d”,a);
 o/p value of variab...
C Theory
Prochain SlideShare
Chargement dans…5
×

C Theory

240 vues

Publié le

Theory on C language

Publié dans : Formation
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

C Theory

  1. 1.  Consists of a set of predefined rules.  These rules form the syntax of that language.  Hence learning a programming language is nothing but learning of that language.
  2. 2.  Computer can understand only instructions written in binary code ( 0 and 1), They do not directly read or understand a any programming language. And so a programming language is converted into binary code by using a special program called compiler.  A program which translates instructions written in a programming language into binary code is called a compiler.  When we write a program in C Language, what we write is called Source Code.  The compiler’s output is called executable code.
  3. 3.  C is a programming language developed at AT&T Bell laboratories around 1972.  It was designed and written by Dennis M. Ritchie.  C was standardized in 1989 by American National Standard Institute (ANSI). So it came to be known as ANSI C.  C is a structured language. It breaks up a program into small parts known as functions.
  4. 4.  Flow chart use to define flow of any program. symbolic representation of program. use different symbols.
  5. 5.  Rectangle  Parallelogram  Diamond  Lines  oval
  6. 6.  Use to define process in program
  7. 7.  Use to define input and output in program
  8. 8.  Use to specify condition in program
  9. 9.  To show flow of the program
  10. 10.  Use to declare start and end of flow chart and connect flow chart with other flow chart pages also.
  11. 11. start end Input outputoutput conditionProcess if true Process if false
  12. 12. start end Insert value of i Print value of I is less than five Print value of I is greater than five If(i<5) Declare variable I as integer
  13. 13. Documentation Symbolic Constant Definition File Include Section Global Variable Declaration Main() { Declaration Executable Statements } Function 1 Function 2 Function n…. starting Section Compulsory section for all C Programs User Defined Functions
  14. 14.  Compile is one type of program to convert source code into machine level code,  Compiler compile the code of block and return the error and warning list.
  15. 15.  #include <stdio.h>  #include <conio.h>  void main() { printf(“My first program”); getch(); }
  16. 16.  #include <stdio.h>  #include <conio.h> # : is pre possessive directive. use to include header files before start the program.
  17. 17.  Header file is collection of pre define functions.  Extension of header file is must “.h”.  Header files are located in “INCLUDE” folder of “TC”.
  18. 18.  void main() { main() c compile founds main() to start execution of program. must declare main function in every program.
  19. 19.  {  braces use to define starting of coding block.
  20. 20.  printf(“My First program”);  printf() : use to print any formatted string in output window of Turbo c. header file : stdio.h ( standard input output )
  21. 21.  getch();  }  getch() use to get 1 character from keyboard. } define end of coding block.
  22. 22.  Compile the source code with. Alt + F9 Run the program with. Crtl + F9
  23. 23.  C language is totally case sensitive language.  All the statements of C language must terminate with semi colon ( ; )
  24. 24.  My First program
  25. 25. file type extension  C- Source file .C  application file .EXE  object file .OBJ
  26. 26.  Comment lines ignore by c compiler // use for single line comment /* */ use for multiline comment
  27. 27.  Integer  Float  Double  Character
  28. 28.  Signed integer range -32,768 to 32,767 occupy first bit as a sigh bit. ( + / - ) memory space ( 2 bytes )
  29. 29.  Unsigned integer range 0 to 65,535 not occupy any bit as sign bit. memory space ( 2 bytes ) Note : to declare unsigned integer variable must use unsigned key word before integer.
  30. 30.  Use to store values with fiction point. memory space ( 4 bytes) 32 bits Double 64 bits(8 bytes) Long double 80 bits(10 bytes)
  31. 31.  Default unsigned character  8 bits ( 1 byte )  Range : 0 to 255  Signed character  8 bits ( 1 byte )  Range : -128 to 127
  32. 32.  int a = 10;  printf(“Value of variable a is : %d”,a);  o/p : Value of variable a is : 10
  33. 33.  %d use for integer values  %f use for float values  %c use for character  %s use for String  %l use for double values  %lf use for long double values
  34. 34.  Use  scanf() function  Syntax :  scanf(“format character ”, &variable name);
  35. 35.  int a;  printf(“Enter value of a ”);  scanf(“%d”,&a);  printf(“Value of variable a is : %d”,a);  o/p value of variable a is : 10 Note : assume that we entered 10 from keyboard.

×