an introduction to programming
DESCRIPTION
An Introduction to Programming. By :- Vishal Hirani B.Tech II year (CSE). What is Programming?. Wiki Definition : The action or process of writing computer programs. What is a Computer Program?. A sequence of instructions that a computer can interpret and execute. How Programming Works?. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: An Introduction to Programming](https://reader031.vdocument.in/reader031/viewer/2022020418/56815fc6550346895dcebcf4/html5/thumbnails/1.jpg)
An Introduction to Programming
By :- Vishal HiraniB.Tech II year (CSE)
![Page 2: An Introduction to Programming](https://reader031.vdocument.in/reader031/viewer/2022020418/56815fc6550346895dcebcf4/html5/thumbnails/2.jpg)
What is Programming?Wiki Definition: The action or process of
writing computer programs.
What is a Computer Program?A sequence of instructions that a computer
can interpret and execute
How Programming Works?A Program tells a computer what to do.
What is a Programming Language?A programming language acts as a translator
between you and the computer.
![Page 3: An Introduction to Programming](https://reader031.vdocument.in/reader031/viewer/2022020418/56815fc6550346895dcebcf4/html5/thumbnails/3.jpg)
How to Write a Program?First : you need a computer Second : you need a text editor.-Talking about Linux, you will be using Gedit.
How to run the program?Using a Compiler
Third : Save the file with extension .c example helloworld.c
![Page 4: An Introduction to Programming](https://reader031.vdocument.in/reader031/viewer/2022020418/56815fc6550346895dcebcf4/html5/thumbnails/4.jpg)
CompilerA compiler is a special program that processes
statements written in a particular programming language and turns them into machine language or "code" that a computer's processor uses.
For Linux this Compiler is GCCAnd it is the compiler for most Unix based
operating system and many languages`
![Page 5: An Introduction to Programming](https://reader031.vdocument.in/reader031/viewer/2022020418/56815fc6550346895dcebcf4/html5/thumbnails/5.jpg)
Algorithm and FlowchartAlgorithm:
-Step by Step method to solve a problem.
-Must include “ALL” required information.Flowchart: -Graphical representation of Algorithm.-Includes Terminal + Process + Decision
![Page 6: An Introduction to Programming](https://reader031.vdocument.in/reader031/viewer/2022020418/56815fc6550346895dcebcf4/html5/thumbnails/6.jpg)
![Page 7: An Introduction to Programming](https://reader031.vdocument.in/reader031/viewer/2022020418/56815fc6550346895dcebcf4/html5/thumbnails/7.jpg)
Average??
![Page 8: An Introduction to Programming](https://reader031.vdocument.in/reader031/viewer/2022020418/56815fc6550346895dcebcf4/html5/thumbnails/8.jpg)
Question: Find the largest of A,B & C
Start
Read A, B & C
Is A>B
Is A>C
Is B>C
Print APrint B Print C
End
YesYes
No
No
No Yes
![Page 9: An Introduction to Programming](https://reader031.vdocument.in/reader031/viewer/2022020418/56815fc6550346895dcebcf4/html5/thumbnails/9.jpg)
Starting with LinuxTerminal (Ctrl+Alt+T)Gedit: “gedit”
ProgramCompiler
Output
![Page 10: An Introduction to Programming](https://reader031.vdocument.in/reader031/viewer/2022020418/56815fc6550346895dcebcf4/html5/thumbnails/10.jpg)
Hello World!/* Hello World program */ #include<stdio.h> int main() { printf("Hello World");return 0;}
CommentHeader File Main function-Function starts Print functionReturning output-Function ends
Remember the .c extension
![Page 11: An Introduction to Programming](https://reader031.vdocument.in/reader031/viewer/2022020418/56815fc6550346895dcebcf4/html5/thumbnails/11.jpg)
Compiler: How to compilegcc filename
![Page 12: An Introduction to Programming](https://reader031.vdocument.in/reader031/viewer/2022020418/56815fc6550346895dcebcf4/html5/thumbnails/12.jpg)
Output: How to Run?./filename.out
![Page 13: An Introduction to Programming](https://reader031.vdocument.in/reader031/viewer/2022020418/56815fc6550346895dcebcf4/html5/thumbnails/13.jpg)
Assignment