Welcome to CS0.101 Computer Programming #
Girish Varma
https://cpro-iiit.github.io/docs/course_material/lectures/1/05_08.pdf
Admin Stuff #
Teaching Team #
Instructors (3): Girish Varma, Abhishek Deshpande, Sandeep Nagar
TAs (20): Devesh, Sirisetti, Mayaank, Priet, Harshvardhan, Shreya, Annamalai, Talib, Druvitha, Aaditya, Tanishq, Sahil, Karan, Manan, Madhav, Yash, Khooshi, Poorvi, Harshit, Sarthak
How to ace this course? #
12 Weeks Course (excluding exam/holiday/prep weeks)
Session | Time (hrs) | Marks (%) |
---|---|---|
3 Lectures | 3 x 1 | - |
1 Tutorial | 1 x 1 | - |
1 Lab | 1 x 3 | 2 |
Reading/Practice | 3 | |
Assignment | 3 | 2.5 |
Total Time per week: 13 hrs
Total Problem solving per week: 3 (Lab) + 2 (Tut) + 2 (Assgn) 2 (Practice) = 9
Evaluation #
Component | Marks (%) | |
---|---|---|
Lab | 10 x 2 | Best 10 of * |
Assignments | 6 x 5 | 6 in No. |
Mid Term | 8 + 12 | Written + Lab |
End Sem | 10 + 20 | Written + Lab |
80% marks for programming problem solving.
Solve 100 problems over the entire course.
Websites #
Course Website: https://cpro-iiit.github.io/ All lecture/lab/tutorial material is posted. Additional information, links to other courses/tutorials on the web.
Autolab Problem Server: https://pingala.iiit.ac.in/ All lab/assignment/tutorials problems released here. More about this in the lab.
Introduction to Computer Programming #
What this Course is about? #
Genie needs to be instructed precisely, otherwise it will not respond!
It will precisely do, what you told it to do! If you meant something else and that was your problem.
Genie only understand a language, which has no scope for confusion/ambiguity.
Basic Computer Organisation #
Programming Languages #
Intro to C Programming #
Hello World! C Program #
main.c
file. Try it out at https://www.programiz.com/c-programming/online-compiler/
// 1. This line is a comment that is ignored by compiler.
// 2. include standard library for input/output. Allows to print to shell
#include <stdio.h>
// 3. execution start inside this **function** named main.
int main()
{ // start of main function
// 4. prints to the shell
printf("Hello, world\n");
return 0; /* 5. returns integer 0 */
} // end of main function
Running the Program #
- Run gcc compiler to get executable file
main
gcc main.c -o main
- Run the executable
main
./main
What just happened? #
Using Makefile to do it together #
- Create a file
Makefile
(one time step)
// Makefile
run:
gcc main.c -o main
./main
- run
make run
Next time, after you modify main.c
, only make run
needs to be done.
Reading #
Chapter 1 upto Section 1.4,
Chapter 2 upto Section 2.2
Computer Science: A Structured Programming Approach Using C
Behrouz A. Forouzan, Richard F. Gilberg
Fundas for doing Programming! #
Tresure Hunt/Dumb charades! #
- Dont be afraid to make guesses!
- Dont be afraid to try out guesses!
- Failed guess gives clues. Learn from them!
- You will eventually learn to make more clever guesses.