Computer Pragraming in C Language Unit 1
Computer Pragraming in C Language Unit 1
to
C
Programming
• C is a programming language
developed at AT & T’s Bell
Laboratories of USA in 1972.
• It was designed and written by a
man named Dennis Ritchie.
• Initially designed for programming
UNIX operating system.
• Device driver programs ,Software
tool and compiler is written in C.
C has now become a widely used professional
language for various reasons:
➢ Easy to learn
➢ Structured language
➢ It produces efficient programs
➢ It can handle low-level activities
➢ It can be compiled on a variety of computer platforms
Program
• Environment Setup
(a) Text Editor
(b) The C Compiler.
Text Editor
• Used type your program.
• Examples : Windows Notepad, OS Edit command, Brief, Epsilon,
EMACS, and vim or vi.
• The files you create with your editor are called
the source files and they contain the program source codes.
• The source files for C programs are typically named with the
extension ".c".
The C Compiler
• The source code written in source file is the human readable
source for your program.
• It needs to be "compiled" into machine language so that your
CPU can actually execute the program as per the instructions
given.
• The compiler compiles the source codes into final executable
programs.
• The most frequently used and free available compiler is the
GNU C/C++ compiler.
Testing is the process using Debugging is the process
which we find errors and using which we correct the
bugs. bugs that we found during the
testing process.
Testing can be manual or
Debugging is always manual.
automated.
Debugging can’t be automated.
What is algorithm?
• An algorithm is a procedure or step-by-step instruction for solving a
problem.
• They form the foundation of writing a program.
• For writing any programs, the following has to be known:
• Input
• Tasks to be preformed
• Output expected
•An algorithm is a set of commands that must be followed for a
computer to perform calculations or other problem-solving
operations.
• Ex: &a
• scanf( ) at which memory location should it
store the value supplied by the user from the
keyboard
#include<stdio.h>
#include<conio.h>
void main()
{
int x;
clrscr();
printf("Enter a number:");
scanf("%d",&x);
printf("Entered Number x=%d",x);
getch();
}