1.first c program

22
First C program Talk to a Teacher http://spoken-tutorial.org National Mission on Education through ICT http://sakshat.ac.in Ashwini R Patil IIT Bombay 4 April 2012 May 31, 2012 Ashwini R Patil First C program

Upload: baqar-rizvi

Post on 03-Dec-2015

226 views

Category:

Documents


1 download

DESCRIPTION

How to write a program in c

TRANSCRIPT

Page 1: 1.First C Program

First C program

Talk to a Teacherhttp://spoken-tutorial.org

National Mission on Education through ICThttp://sakshat.ac.in

Ashwini R PatilIIT Bombay

4 April 2012

May 31, 2012Ashwini R Patil First C program

Page 2: 1.First C Program

Learning Objectives

I How to write a simple C program

I How to compile it

I How to execute it

I Some common errors and their solutions

Ashwini R Patil First C program

Page 3: 1.First C Program

Learning Objectives

I How to write a simple C program

I How to compile it

I How to execute it

I Some common errors and their solutions

Ashwini R Patil First C program

Page 4: 1.First C Program

Learning Objectives

I How to write a simple C program

I How to compile it

I How to execute it

I Some common errors and their solutions

Ashwini R Patil First C program

Page 5: 1.First C Program

Learning Objectives

I How to write a simple C program

I How to compile it

I How to execute it

I Some common errors and their solutions

Ashwini R Patil First C program

Page 6: 1.First C Program

Learning Objectives

I How to write a simple C program

I How to compile it

I How to execute it

I Some common errors and their solutions

Ashwini R Patil First C program

Page 7: 1.First C Program

System Requirements

I Ubuntu Operating System version 11.10

I GCC Compiler version 4.6.1 on Ubuntu

Ashwini R Patil First C program

Page 8: 1.First C Program

System Requirements

I Ubuntu Operating System version 11.10

I GCC Compiler version 4.6.1 on Ubuntu

Ashwini R Patil First C program

Page 9: 1.First C Program

System Requirements

I Ubuntu Operating System version 11.10

I GCC Compiler version 4.6.1 on Ubuntu

Ashwini R Patil First C program

Page 10: 1.First C Program

Prerequisites

I Ubuntu Operating System

I An Editor

I Eg. vim, gedit

I For relevant tutorials please visit ourwebsite: http://spoken-tutorial.org

Ashwini R Patil First C program

Page 11: 1.First C Program

Prerequisites

I Ubuntu Operating System

I An Editor

I Eg. vim, gedit

I For relevant tutorials please visit ourwebsite: http://spoken-tutorial.org

Ashwini R Patil First C program

Page 12: 1.First C Program

Prerequisites

I Ubuntu Operating System

I An Editor

I Eg. vim, gedit

I For relevant tutorials please visit ourwebsite: http://spoken-tutorial.org

Ashwini R Patil First C program

Page 13: 1.First C Program

Prerequisites

I Ubuntu Operating System

I An Editor

I Eg. vim, gedit

I For relevant tutorials please visit ourwebsite: http://spoken-tutorial.org

Ashwini R Patil First C program

Page 14: 1.First C Program

Prerequisites

I Ubuntu Operating System

I An Editor

I Eg. vim, gedit

I For relevant tutorials please visit ourwebsite: http://spoken-tutorial.org

Ashwini R Patil First C program

Page 15: 1.First C Program

function main()

I Every program should have one main()function

I There should NOT be more than onemain() function

I Otherwise the compiler cannot locate thebeginning of the program

I The empty pair of parentheses indicatesthat main has no arguments

Ashwini R Patil First C program

Page 16: 1.First C Program

function main()

I Every program should have one main()function

I There should NOT be more than onemain() function

I Otherwise the compiler cannot locate thebeginning of the program

I The empty pair of parentheses indicatesthat main has no arguments

Ashwini R Patil First C program

Page 17: 1.First C Program

function main()

I Every program should have one main()function

I There should NOT be more than onemain() function

I Otherwise the compiler cannot locate thebeginning of the program

I The empty pair of parentheses indicatesthat main has no arguments

Ashwini R Patil First C program

Page 18: 1.First C Program

function main()

I Every program should have one main()function

I There should NOT be more than onemain() function

I Otherwise the compiler cannot locate thebeginning of the program

I The empty pair of parentheses indicatesthat main has no arguments

Ashwini R Patil First C program

Page 19: 1.First C Program

Assignment

I Write a program to print“Welcome to the World of C”

I See what happens if \n is not included inthe printf statement

Ashwini R Patil First C program

Page 20: 1.First C Program

About the Spoken Tutorial Project

I Watch the video available athttp://spoken-tutorial.org/What is a Spoken Tutorial

I It summarises the Spoken Tutorial project

I If you do not have good bandwidth, youcan download and watch it

Ashwini R Patil First C program

Page 21: 1.First C Program

Spoken Tutorial Workshops

The Spoken Tutorial Project Team

I Conducts workshops using spokentutorials

I Gives certificates to those who pass anonline test

I For more details, please write [email protected]

Ashwini R Patil First C program

Page 22: 1.First C Program

Acknowledgements

I Spoken Tutorial Project is a part of theTalk to a Teacher project

I It is supported by the National Missionon Education through ICT, MHRD,Government of India

I More information on this Mission isavailable at:http://spoken-tutorial.org/NMEICT-Intro

Ashwini R Patil First C program