over all view programming to computer

Embed Size (px)

Citation preview

2016

By: ENGR MUNIR AHMED MAHAR

According to new pattern of Karachi intermediate board of education. This notes are divided into C language Programming And Database with Ms-Access

C

C is a programming language developed at AT & Ts Bell Laboratories of USA in 1972 by

Dennis Ritchie.

C is a computer Programming language that means that you can use c to create lists of instruction for a computer to follow c is one of thousands of programming languages currently in use c has been around for several decades and has won widespread acceptation because it gives programmers maximum control and efficiency. C is an easy to learn it is a bit more cryptic in its style than some other languages, but get beyond that fairly quickly.

FEATURES OF C LANGUAGE:

C is a case sensitive language

C is a collection of libraries

Libraries is a collection of Functions

Function is a collection of Statements

Statements is a collection of Collectors

C language can Support IDE Integrated Development Envorment

C language can support only Compiler Translators

A C file Must Be .cpp (C plus plus)

C Keywords

Keywords are the words whose meaning has already been explained to the C compiler (or in a broad sense to the computer). The keywords cannot be used as variable names because if we do so we are trying to assign a new meaning to the keyword, which is not allowed by the computer. Some C compilers allow you to construct variable names that exactly resemble the keywords. However, it would be safer not to mix up the variable names and the keywords. The keywords are also called Reserved words.

IDE:

IDE abbreviate as Integrated development envorment. It is a platform that we can type any c program, compile, execution and display of results. IDE is a programming envorment that typically consist of code editor, a compiler, a debug and graphical user interface (GUI). The IDE is May stay alone application or may be included as a part of computer program. IDE is and interface between user and computer that perform simultaneously.

COMMON EXAMPLE: GW-Basic, Visual Basic, C Language etc

2Prepared By: Muzmil Memon | email: [email protected]: Define Header Files?

HEADER FILES:

DEFINATION:

Header file is a collection of function that found in different libraries. A header file is always define in the top of program and found in include directory. The header files are always assigned with sign of #. An every header file contains different functions like library is containing of different mathematical functions.

Q: How Many Files to generate a compiler after the execution of C Program?

C FILES:

There are four files to generate a compiler automatically 1. .Cpp

2. .Bak

3. .Obj

4. .Exe

.CPP

The .Cpp is a source file that based on a c programming code without this file we cannot maintain other files the extension of .cpp is recognize as c plus plus code

.BAK

The backup file is automatically generated file that provide backup of source code suppose the source file is deleted we can use backup file as a source code but it necessary to rename the extension of file as .cpp

.OBJ

The .obj is object oriented file that contain a machine code and store errors, values, and result oriented machine code without the object file the source program cannot entertain.

.EXE (Executable File)

The Executable file is run without any support of program sometimes it called compiled file so the .exe file is a powerful extension that execute computer programs and there is no need to install any computer program

3Prepared By: Muzmil Memon | email: [email protected]: What are Format Specifies?

FORMAT SPECIFERS

A format Specifers are used to convert the particular data. A format specifer program very important rule because when we store the data in the computer memory. These specifers can convert the data and display the accurate result.

Format Specifers Are:

SPECIFERSCONVERSATION%cSingle Character%sString Data type%dInteger data type%fFloat data type%lLong data type%flDouble data type%xHexadecimal data type%oOctal Data type

4Prepared By: Muzmil Memon | email: [email protected]: Define Gotoxy Statements?

Goto xy statements:

The goto xy statement is used to set the cursor on the screen and display text on the particular column and row/line. There are 256 columns ( 0 to 255) and 25 rows (0 to 24). SYNTEX: goto xy (C,R);

EXAMPLE:

Gotoxy(10,10); Printf( YASIR );

Q: Define Goto Statements?

GOTO STATEMENT:

The goto statement is a branching statement that we can move the cursor in the particular line sometimes we can say its a conditional statement.

SYNTEX: goto c;EXAMPLE:

Char a=B; c:

printf( HI); getche(); goto c;

If no return statement found in function definition, the control automatically returns to the calling of function. If a return value is not required, declare the function with the data type of void otherwise to return the integer data type.

Q: Define Return Statements?

RETURN STATEMENT:

The calling of function. The return function is also used to return the value of

The return statement is used to terminate the execution of function and return to

calling of function.

SYNTEX: return expression

5Prepared By: Muzmil Memon | email: [email protected] STATEMENT:

The break statement is used to terminate the nearest statement or do, for , switch-case and while statement. The break statement is also perform in loops it mean we can terminate in the mid of loop.

SYNTEX: break;EXAMPLE:Int a;

Printf(1.Books Name); Printf( 2. Exit ); Switch(no){Case 1;

Printf( C language ); Break;Default:Break;Printf(Wrong Entry);}

Q: Define Continue Statements?

CONTINUE STATEMENT:

The continue statement is used to pass the control of next iteration of the nearest dowhile, and for and by pass the remaining statements in the do, for, and while statement of the body.

SYNTEX: continue;

The Continue statement is always perform when we cross of the body of the any loop and moves the cursor or pointer in the next statement.

EXAMPLE:

void main (void)

{

clrscr(); int a;for(a=1;a