L1-Introduction To Computers and C Programming
L1-Introduction To Computers and C Programming
CPU
Main memory
00011111
Input device(s) 10101100 Output device(s)
11100011
Secondary memory
Bytes and Addresses
Software
Operating
Programs
System
What is a program?
Compiler
Object code for
other routines
Start
Translating
Problem to C++
definition
Testing
Algorithm
design
Desktop Working
testing Program
The Software Development
Method
B programming language
• Dennis Ritchie
C programming language • 1970s
• Bjarne Stroustrap
•
C++ 1980s
Layout of a C++ Program
#include <iostream>
using namespace std;
Program starts here
int main()
{
Variable_Declarations
Statement_1
Statement_2
…
Statement_Last
return 0;
} Program ends here
Layout of a C++ Program
#include <iostream> include directive
using namespace std;
standard namespace
int main()
{ main function
Variable_Declarations
Statement_1
Statement_2 executable statements
…
Statement_Last
#include <iostream>
using namespace std;
int main()
{
int number1, number2, sum;
return 0;
}
Compiling and Running a C++ Program
Testing and Debugging
Bug
A mistake/error in the program
Debugging
The process of eliminating bugs in a program
Testing and Debugging
product =…………………..?
return 0;
}
Thank You