L-01: Introduction

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) ​

SessionTime (hrs)Marks (%)
3 Lectures3 x 1-
1 Tutorial1 x 1-
1 Lab1 x 32
Reading/Practice3
Assignment32.5

Total Time per week: 13 hrs
Total Problem solving per week: 3 (Lab) + 2 (Tut) + 2 (Assgn) 2 (Practice) = 9


Evaluation #

ComponentMarks (%)
Lab10 x 2Best 10 of *
Assignments6 x 56 in No.
Mid Term8 + 12Written + Lab
End Sem10 + 20Written + 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? #

bg right:50% w:500

  • 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 #

bg right:60% w:600



Programming Languages #

bg right:50% w:600



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 #

  1. Run gcc compiler to get executable file main gcc main.c -o main
  2. Run the executable main ./main

What just happened? #

bg right:50% w:600


Using Makefile to do it together #

  1. Create a file Makefile (one time step)
// Makefile
run: 
    gcc main.c -o main
    ./main
  1. 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.

Thanks #