Вы находитесь на странице: 1из 8

Submitted by; Sundas ajmal (40) Abida sadique (36) Saira batool (41) Sara basharat (35) Anum

mukhtar (42) Bushra ramzan (51) Iqra afzal (47) Binish mansha ( ) Aasma irshad (39) Submitted to; Madam binish Class; Bsc 4th sem Subject; Project on c and c++

The C Language
Currently, the most commonly-used language for embedded systems High-level assemblyand compilers exist for virtually every processor and Easy-to-understand compilation and it is Produces efficient code

C History
Developed between 1969 and 1973 along with Unix with the help of Dennis Ritchie and Designed for systems programming and can be done operation on Operating systems ,Utility programs , Compilers , Filters. This language is Evolved from B, which evolved from BCPL in past Original machine (DEC PDP-11) was very small 24K bytes of memory, 12K used for operating system Meant BCPLs word-based model was insufficient

First introductive programme on c


Hello World in C #include <stdio.h> void main() { printf(Hello, world!\n); }

Expressions in c
Arithmetic, logical, and assignment operators in an infix notation

Statements
Sequences of conditional, iteration, and branching instructions

Functions
Groups of statements and variables invoked recursively Basic types: char, int, float, and double

C Data Types

Declaration syntax
string of specifiers followed by a declarator Declarators notation matches that in an expression Access a symbol using its declarator and get the basic type back

Programme consist of two parts


Preprocessor directives Main() function

Preprocessors

These are the set of instruction given to the programme that how to compile or run a programme

These instruction are given at the beginning of the programme Example include , define Include Include is preprocessor and use for including header files from the library function in to the programme Syntax #include < name of the header file> The main() function Every c language contain programme must contain a main() function Programme cant run with out it Statement enclosed in curly braces { } { indicates start of the body }indicates end of body Every instruction written in it is called statement And semicolon is used end of every statement and known as terminator Input function Scanf Cin Output function Cout printf

header files

Iostream.h In the C++ programming language, Input/output library refers to a family of class templates and supporting functions in the C++ Standard Library that implement stream-based input/output capabilities Math.h mathematical functions are placed in math.h header (cmath header in C++). The functions that operate on integers, such as abs, labs, div, and ldiv, are instead specified in the stdlib.h header (cstdlib header in C++). stdio.h is the header file for console input and output operations usually it is written as: #include <stdio.h> Void main main() is a primary function which is included in all C Programs. When we write void main(). It means that this main() program will not return value. And if we write int main(). It means this program will return an integer type value.

Programming Step 1;
First click on start button

Step 2;
Then select the programs and go to turbo c++ 4.5 from the go to the turbo c++.exe

Step 3; A blank turbo window will be open then start writting a programme

Step 4; Programme for NCR or communication

x = i * fact(i - 1) ; return x ; } }

Output

Step5;

Programme for sine values

Output

Step 6 ;

Programme for cosine values

Output

Step7 Programmefor adding two matrices

Output

Вам также может понравиться