CS1000 Basic Programming: Computing Lab - II
CS1000 Basic Programming: Computing Lab - II
Basic Programming
Programming
Language
Instructions
Program
Programmer Computer
Why C? History and why you should
study C?
Inventor – Dennis Ritchie in 1972 (Book : The C
Programming Language - Ritchie & kernighan)
Why we call is C? Why now D, E, F, G etc. ?
It’s the successor of B Language and B language is
the successor of BCPL (Basic Combined
Programming Language).
BCPL
C
Why C? History and why you should
study C?
A basic foundation for learning programming
language elements: easy and simple to learn
Efficient and reliable
C is a general purpose programming language:
Embedded System Programs are written in C
Microwave Oven
Washing machines
Digital Cameras
NASA MARS ROVER
Why C? History and why you should
study C?
Major parts of popular OS like windows, Linux, Unix
are written in C.
C provides several language elements that makes
interaction with hardware.
Several Gaming programs are also developed in C.
If you know C then learning C++, Java and C# is very
easy.
Programming Languages
.exe
First C Program
/* Comments within code*/ To include
information about
#include<stdio.h> standard
main() Function main input/output
{
printf(“Hello World\n”); Body of Function
}
Second C Program
/* This program accepts an integer as
input and outputs the same integer*/
#include <stdio.h>
main ()
{
int n;
scanf("%d",&n);
printf("%d\n",n);
}
Third C Program
/* This program takes an integer n as
input and outputs the square n2 of n.*/
#include <stdio.h>
main ()
{
int n;
scanf("%d",&n);
printf("%d\n",n*n);
}
How to run a program in Windows
Toolset- Turbo C, GNU C Compiler, MS Visual C,
“ANSI C” by Balaguruswamy