SlideShare a Scribd company logo
1 of 34
1
What is programming?
Input:
A command which is
given by the
programmer
e.g.
We are EEE family
(We want to print out
what we’ve written)
Processing Unit:
 Analysing the command
 Converting input command in
binary data
 Process the binary command
 Converting to aspect result
e.g.
i. We are EEE family = 0101…..
ii. Process 0101……
iii. 0101= We are EEE family
Output:
Result of the process
e.g.
We are EEE family
(Computer’ve printed
out what we had
wanted to write)
2
What is compiler?
Compilers we specially require:
• Code-blocks (for c or c++ programming)
• Net-Beans (for Java or Android programming)
3
4
C Symbolic patterns
General knowledge of C coding:
CODING:
5
#include <stdio.h>
//include standard input & output numbers
#include <stdlib.h>
//include standard library numbers
int main()
// main function , integer type ,not including any arguments
{
printf(" ");
// means new line
return 0;
//main function doesn’t return any value
}
6
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf(" ");
return 0;
}
Data types:
7
Bytes Required:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a;
float b;
char c;
int s1,s2,s3;
s1=sizeof(a);
s2=sizeof(b);
s3=sizeof(c);
printf ("%d %d %d ",s1,s2,s3);
return 0;
}
 An integer requires 4 bytes
of Memory
 A float requires 4 bytes of
Memory
 A character requires 1 byte
of Memory
 A string requires (x + Null)
bytes . Here x is its total
bytes of characters
Some important Functions & Features:
8
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i;
for (i=0;i<10;i++)
{
printf("%dn",i);
}
for (i=9;i>=0;i--)
{
printf("%dn",i);
}
return 0;
}
9
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i=0;
while(i<10)
{
printf("%dn",i);
i++;
}
int y=1;
while(y==1)
{
printf("while function is working n");
printf("Press 1 to continue else any key to close:");
scanf("%d",&y);
}
return 0;
}
10
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i=0;
do
{
printf("%dn",i);
i++;
}
while(i<10);
return 0;
}
11
Array
12
User define function:
13
User define function:
14
Pointer variable:
15
C programs 16
17
18
19
20
21
22
23
24
25
int factorial (int a)
{
int i,b=1;
for (i=1;i<=a;i++)
{
b=b*i;
}
return(b);
}
26
27
28
29
30
31
32
33
34

More Related Content

Viewers also liked (7)

Understanding network-visibility
Understanding network-visibilityUnderstanding network-visibility
Understanding network-visibility
 
FLW SM Cover Letter
FLW SM Cover LetterFLW SM Cover Letter
FLW SM Cover Letter
 
Teaching & Learning Certificate - I
Teaching & Learning Certificate - ITeaching & Learning Certificate - I
Teaching & Learning Certificate - I
 
Stump the bishopric
Stump the bishopricStump the bishopric
Stump the bishopric
 
suatu pemikiran umum Filsafat ilmu
suatu pemikiran umum Filsafat ilmusuatu pemikiran umum Filsafat ilmu
suatu pemikiran umum Filsafat ilmu
 
Yeisy cordova
Yeisy cordovaYeisy cordova
Yeisy cordova
 
Urban myths about learning and education for #beyondclicknext
Urban myths about learning and education for #beyondclicknextUrban myths about learning and education for #beyondclicknext
Urban myths about learning and education for #beyondclicknext
 

Similar to Learning c programming by rbm

Similar to Learning c programming by rbm (20)

l1-introduction_to_computers_and_c_programming.pptx
l1-introduction_to_computers_and_c_programming.pptxl1-introduction_to_computers_and_c_programming.pptx
l1-introduction_to_computers_and_c_programming.pptx
 
C Theory
C TheoryC Theory
C Theory
 
Unit 5
Unit 5Unit 5
Unit 5
 
Fp201 unit2 1
Fp201 unit2 1Fp201 unit2 1
Fp201 unit2 1
 
C Programming
C ProgrammingC Programming
C Programming
 
Cpp
CppCpp
Cpp
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Basics Of C++.pptx
Basics Of C++.pptxBasics Of C++.pptx
Basics Of C++.pptx
 
C - ISRO
C - ISROC - ISRO
C - ISRO
 
C programming languag for cse students
C programming languag for cse studentsC programming languag for cse students
C programming languag for cse students
 
Lect '1'
Lect '1'Lect '1'
Lect '1'
 
General structure of c++
General structure of c++General structure of c++
General structure of c++
 
Programming using c++ tool
Programming using c++ toolProgramming using c++ tool
Programming using c++ tool
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 
C++ AND CATEGORIES OF SOFTWARE
C++ AND CATEGORIES OF SOFTWAREC++ AND CATEGORIES OF SOFTWARE
C++ AND CATEGORIES OF SOFTWARE
 
Learn python
Learn pythonLearn python
Learn python
 
C++ programming language basic to advance level
C++ programming language basic to advance levelC++ programming language basic to advance level
C++ programming language basic to advance level
 
Lecture-01-2020J.pptx
Lecture-01-2020J.pptxLecture-01-2020J.pptx
Lecture-01-2020J.pptx
 
C structure
C structureC structure
C structure
 
C
CC
C
 

Learning c programming by rbm

  • 1. 1
  • 2. What is programming? Input: A command which is given by the programmer e.g. We are EEE family (We want to print out what we’ve written) Processing Unit:  Analysing the command  Converting input command in binary data  Process the binary command  Converting to aspect result e.g. i. We are EEE family = 0101….. ii. Process 0101…… iii. 0101= We are EEE family Output: Result of the process e.g. We are EEE family (Computer’ve printed out what we had wanted to write) 2
  • 3. What is compiler? Compilers we specially require: • Code-blocks (for c or c++ programming) • Net-Beans (for Java or Android programming) 3
  • 5. General knowledge of C coding: CODING: 5 #include <stdio.h> //include standard input & output numbers #include <stdlib.h> //include standard library numbers int main() // main function , integer type ,not including any arguments { printf(" "); // means new line return 0; //main function doesn’t return any value }
  • 6. 6 #include <stdio.h> #include <stdlib.h> int main() { printf(" "); return 0; }
  • 7. Data types: 7 Bytes Required: #include <stdio.h> #include <stdlib.h> int main() { int a; float b; char c; int s1,s2,s3; s1=sizeof(a); s2=sizeof(b); s3=sizeof(c); printf ("%d %d %d ",s1,s2,s3); return 0; }  An integer requires 4 bytes of Memory  A float requires 4 bytes of Memory  A character requires 1 byte of Memory  A string requires (x + Null) bytes . Here x is its total bytes of characters
  • 8. Some important Functions & Features: 8 #include <stdio.h> #include <stdlib.h> int main() { int i; for (i=0;i<10;i++) { printf("%dn",i); } for (i=9;i>=0;i--) { printf("%dn",i); } return 0; }
  • 9. 9 #include <stdio.h> #include <stdlib.h> int main() { int i=0; while(i<10) { printf("%dn",i); i++; } int y=1; while(y==1) { printf("while function is working n"); printf("Press 1 to continue else any key to close:"); scanf("%d",&y); } return 0; }
  • 10. 10 #include <stdio.h> #include <stdlib.h> int main() { int i=0; do { printf("%dn",i); i++; } while(i<10); return 0; }
  • 11. 11
  • 17. 17
  • 18. 18
  • 19. 19
  • 20. 20
  • 21. 21
  • 22. 22
  • 23. 23
  • 24. 24
  • 25. 25 int factorial (int a) { int i,b=1; for (i=1;i<=a;i++) { b=b*i; } return(b); }
  • 26. 26
  • 27. 27
  • 28. 28
  • 29. 29
  • 30. 30
  • 31. 31
  • 32. 32
  • 33. 33
  • 34. 34