SlideShare a Scribd company logo
1 of 10
Download to read offline
Welcome to the world of Computer Programming Language learning!
Here I’ll present a short description about opening a project and use it
multiple times and running your first program.
At first install code-blocks and open it
Now click “open a new project”
Now give a title and select a save directory in your expected place
See left, under workspace expand sources and open main.cpp
Build the code using the wheel key shown
The Run the code
Press any key
Now close code blocks
Now go the folder
Now delete the main.cpp and main.o files(the directories are shown in the pic)
Now open code blocks
From menu go the
File>new>file
Select c/c++ source file
Then select C
Give a title and save it to the test(the project folder that you created earlier)
Now write the sample code
Now build it and Run
Now you have successfully run a C code.
Congratulations……..
Some points about the sample code.
Consider the following portion as a skeleton of c code. You are not supposed
to understand everything in todays class, since many aspects are yet to be
touched, after four/five classes you’ll understand the different parts of this
code.
#include<stdio.h>
int main()
{
return 0;
}
Here “#” overrides the administrative privilege
Then include tells the compiler to add some header file
“<stdio.h>” is standard input/output header file. Here some common codes
regarding showing something on screen or taking input, are stored so that we
needn’t write the same code every time, but use a shortcut key instead.
“int main()” is a function declaration where int is the return type of the result
of the function, main is the function name and within parenthesis, we usually
give function arguments.
In a single c code there must be one “main”function which is the brain of the
code and maintain other functions when used (be patient! We’ll come to that
later).
Since we used an int(key word for integer), we wrote return 0;
A “;” ends any statement.
Curly brace”{ }” bind a code segment.
Here we’ve used a library(defined) function “printf”.
Printf can show anything that you write within double quote “printf(“ write
here ”);”.
If you write two printf within the code, like
printf(“first line”);
printf(“second line”);
when u run these then you’ll see that there are no space between those two
lines. If u want to give something like “enter”, then use “n” that gives an
enter explicitly.
Like
printf(“first linen”);
printf(“second line”);
or try this
printf(“first linen”);
printf(“nsecond line”);
then this
printf(“first linenn”);
printf(“nnsecond line”);
you can give tabs by”t”
printf(“first t line”);
printf(“second line”);
Now u can show anything to the user through the command prompt screen,
try doing these things at home until the next class.
In the next class we’ll learn how to take information from user and manioulte
them and then give user a response.

More Related Content

What's hot

Storage classes in c language
Storage classes in c languageStorage classes in c language
Storage classes in c languagetanmaymodi4
 
Csc1100 lecture05 ch05
Csc1100 lecture05 ch05Csc1100 lecture05 ch05
Csc1100 lecture05 ch05IIUM
 
Microsoft Silverlight
Microsoft SilverlightMicrosoft Silverlight
Microsoft Silverlightguest3a8196
 
escape sequences and substitution markers
escape sequences and substitution markersescape sequences and substitution markers
escape sequences and substitution markersMicheal Ogundero
 
computer notes - Conversion from infix to postfix
computer notes - Conversion from infix to postfixcomputer notes - Conversion from infix to postfix
computer notes - Conversion from infix to postfixecomputernotes
 
csharp repitition structures
csharp repitition structurescsharp repitition structures
csharp repitition structuresMicheal Ogundero
 
C++ Course - Lesson 1
C++ Course - Lesson 1C++ Course - Lesson 1
C++ Course - Lesson 1Mohamed Ahmed
 
Introduction to Matlab Scripts
Introduction to Matlab ScriptsIntroduction to Matlab Scripts
Introduction to Matlab ScriptsShameer Ahmed Koya
 
Presentation on nesting of loops
Presentation on nesting of loopsPresentation on nesting of loops
Presentation on nesting of loopsbsdeol28
 
Looping statement
Looping statementLooping statement
Looping statementilakkiya
 
Test driven development
Test driven developmentTest driven development
Test driven developmentXebia India
 
OOPS With CSharp - Jinal Desai .NET
OOPS With CSharp - Jinal Desai .NETOOPS With CSharp - Jinal Desai .NET
OOPS With CSharp - Jinal Desai .NETjinaldesailive
 
Looping statements in C
Looping statements in CLooping statements in C
Looping statements in CJeya Lakshmi
 
What comments hide
What comments hideWhat comments hide
What comments hidePVS-Studio
 

What's hot (20)

AS TASKS #8
AS TASKS #8AS TASKS #8
AS TASKS #8
 
Storage classes in c language
Storage classes in c languageStorage classes in c language
Storage classes in c language
 
Csc1100 lecture05 ch05
Csc1100 lecture05 ch05Csc1100 lecture05 ch05
Csc1100 lecture05 ch05
 
Python session3
Python session3Python session3
Python session3
 
Microsoft Silverlight
Microsoft SilverlightMicrosoft Silverlight
Microsoft Silverlight
 
C language 2
C language 2C language 2
C language 2
 
R basic syntax
R   basic syntaxR   basic syntax
R basic syntax
 
escape sequences and substitution markers
escape sequences and substitution markersescape sequences and substitution markers
escape sequences and substitution markers
 
C# Loops
C# LoopsC# Loops
C# Loops
 
computer notes - Conversion from infix to postfix
computer notes - Conversion from infix to postfixcomputer notes - Conversion from infix to postfix
computer notes - Conversion from infix to postfix
 
csharp repitition structures
csharp repitition structurescsharp repitition structures
csharp repitition structures
 
C++ Course - Lesson 1
C++ Course - Lesson 1C++ Course - Lesson 1
C++ Course - Lesson 1
 
Introduction to Matlab Scripts
Introduction to Matlab ScriptsIntroduction to Matlab Scripts
Introduction to Matlab Scripts
 
Presentation on nesting of loops
Presentation on nesting of loopsPresentation on nesting of loops
Presentation on nesting of loops
 
Looping statement
Looping statementLooping statement
Looping statement
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
selection structures
selection structuresselection structures
selection structures
 
OOPS With CSharp - Jinal Desai .NET
OOPS With CSharp - Jinal Desai .NETOOPS With CSharp - Jinal Desai .NET
OOPS With CSharp - Jinal Desai .NET
 
Looping statements in C
Looping statements in CLooping statements in C
Looping statements in C
 
What comments hide
What comments hideWhat comments hide
What comments hide
 

Similar to First Class

(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.ppt(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.pptatulchaudhary821
 
C programming on Ubuntu
C programming on UbuntuC programming on Ubuntu
C programming on UbuntuBinu Joy
 
Programming For As Comp
Programming For As CompProgramming For As Comp
Programming For As CompDavid Halliday
 
Programming For As Comp
Programming For As CompProgramming For As Comp
Programming For As CompDavid Halliday
 
C language industrial training report
C language industrial training reportC language industrial training report
C language industrial training reportRaushan Pandey
 
Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c languagefarishah
 
Chapter1 introduction it2
Chapter1 introduction it2Chapter1 introduction it2
Chapter1 introduction it2Kinglan Galon
 
Chapter 2 - Structure of C++ Program
Chapter 2 - Structure of C++ ProgramChapter 2 - Structure of C++ Program
Chapter 2 - Structure of C++ ProgramDeepak Singh
 
Programming basics
Programming basicsProgramming basics
Programming basicsillidari
 
Programming Fundamentals lecture 5
Programming Fundamentals lecture 5Programming Fundamentals lecture 5
Programming Fundamentals lecture 5REHAN IJAZ
 
His162013 140529214456-phpapp01
His162013 140529214456-phpapp01His162013 140529214456-phpapp01
His162013 140529214456-phpapp01Getachew Ganfur
 
88 c programs 15184
88 c programs 1518488 c programs 15184
88 c programs 15184Sumit Saini
 
Boo Manifesto
Boo ManifestoBoo Manifesto
Boo Manifestohu hans
 

Similar to First Class (20)

(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.ppt(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.ppt
 
C programming on Ubuntu
C programming on UbuntuC programming on Ubuntu
C programming on Ubuntu
 
Programming For As Comp
Programming For As CompProgramming For As Comp
Programming For As Comp
 
Programming For As Comp
Programming For As CompProgramming For As Comp
Programming For As Comp
 
C language industrial training report
C language industrial training reportC language industrial training report
C language industrial training report
 
Lab 1.pptx
Lab 1.pptxLab 1.pptx
Lab 1.pptx
 
The basics of c programming
The basics of c programmingThe basics of c programming
The basics of c programming
 
C language tutorial
C language tutorialC language tutorial
C language tutorial
 
Cordovilla
CordovillaCordovilla
Cordovilla
 
Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c language
 
Chapter1 introduction it2
Chapter1 introduction it2Chapter1 introduction it2
Chapter1 introduction it2
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
 
Chapter 2 - Structure of C++ Program
Chapter 2 - Structure of C++ ProgramChapter 2 - Structure of C++ Program
Chapter 2 - Structure of C++ Program
 
Programming basics
Programming basicsProgramming basics
Programming basics
 
Programming Fundamentals lecture 5
Programming Fundamentals lecture 5Programming Fundamentals lecture 5
Programming Fundamentals lecture 5
 
C++ for hackers
C++ for hackersC++ for hackers
C++ for hackers
 
His162013 140529214456-phpapp01
His162013 140529214456-phpapp01His162013 140529214456-phpapp01
His162013 140529214456-phpapp01
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
 
88 c programs 15184
88 c programs 1518488 c programs 15184
88 c programs 15184
 
Boo Manifesto
Boo ManifestoBoo Manifesto
Boo Manifesto
 

First Class

  • 1. Welcome to the world of Computer Programming Language learning! Here I’ll present a short description about opening a project and use it multiple times and running your first program. At first install code-blocks and open it Now click “open a new project”
  • 2. Now give a title and select a save directory in your expected place
  • 3. See left, under workspace expand sources and open main.cpp
  • 4. Build the code using the wheel key shown The Run the code
  • 5. Press any key Now close code blocks Now go the folder Now delete the main.cpp and main.o files(the directories are shown in the pic)
  • 6. Now open code blocks From menu go the File>new>file Select c/c++ source file Then select C
  • 7. Give a title and save it to the test(the project folder that you created earlier)
  • 8. Now write the sample code Now build it and Run Now you have successfully run a C code. Congratulations……..
  • 9. Some points about the sample code. Consider the following portion as a skeleton of c code. You are not supposed to understand everything in todays class, since many aspects are yet to be touched, after four/five classes you’ll understand the different parts of this code. #include<stdio.h> int main() { return 0; } Here “#” overrides the administrative privilege Then include tells the compiler to add some header file “<stdio.h>” is standard input/output header file. Here some common codes regarding showing something on screen or taking input, are stored so that we needn’t write the same code every time, but use a shortcut key instead. “int main()” is a function declaration where int is the return type of the result of the function, main is the function name and within parenthesis, we usually give function arguments. In a single c code there must be one “main”function which is the brain of the code and maintain other functions when used (be patient! We’ll come to that later). Since we used an int(key word for integer), we wrote return 0; A “;” ends any statement. Curly brace”{ }” bind a code segment. Here we’ve used a library(defined) function “printf”. Printf can show anything that you write within double quote “printf(“ write here ”);”. If you write two printf within the code, like
  • 10. printf(“first line”); printf(“second line”); when u run these then you’ll see that there are no space between those two lines. If u want to give something like “enter”, then use “n” that gives an enter explicitly. Like printf(“first linen”); printf(“second line”); or try this printf(“first linen”); printf(“nsecond line”); then this printf(“first linenn”); printf(“nnsecond line”); you can give tabs by”t” printf(“first t line”); printf(“second line”); Now u can show anything to the user through the command prompt screen, try doing these things at home until the next class. In the next class we’ll learn how to take information from user and manioulte them and then give user a response.