Computer Programming 0455-3391-01. A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return.

Slides:



Advertisements
Similar presentations
An Introduction to Programming By :- Vishal Hirani B.Tech II year (CSE)
Advertisements

Write a program step by step. Step 1: Problem definition. Given the coordinate of two points in 2-D space, compute and print their straight distance.
C Introduction Lesson CS1313 Spring C Introduction Lesson Outline 1.C Introduction Lesson Outline 2. hello_world.c 3.C Character Set 4.C is Case.
Introduction to C++ Programming. A Simple Program: Print a Line of Text // My First C++ Program #include int main( ) { cout
Your First Java Program: HelloWorld.java
C Introduction Lesson CS1313 Spring C Introduction Lesson Outline 1.C Introduction Lesson Outline 2. hello_world.c 3.C Character Set 4.C is Case.
C Programming for engineers Teaching assistant: Ben Sandbank Home page:
Programming The Development Environment and Your First C Program.
1 ICS103 Programming in C Lecture 2: Introduction to C (1)
1 3D Modelling with OpenGL Brian Farrimond Robina Hetherington.
CMSC 104, Version 9/011 Introduction to C Topics Compilation Using the gcc Compiler The Anatomy of a C Program 104 C Programming Standards and Indentation.
Introduction to C++ - How C++ Evolved Most popular languages currently: COBOL, Fortran, C, C++, Java (script) C was developed in 1970s at AT&T (Richie)
CS140: Intro to CS An Overview of Programming in C by Erin Chambers.
C# B 1 CSC 298 Writing a C# application. C# B 2 A first C# application // Display Hello, world on the screen public class HelloWorld { public static void.
History of C and C++ C++ evolved from C ANSI C C++ “spruces up” C
1 Agenda Administration Background Our first C program Working environment Exercise Memory and Variables.
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
Programming With C.
Output in Java Hello World!. Structure of a Java Program  All Java files in ICS3U1 have the following structure: class HelloWorld { }  Notice the open.
1 A simple C++ program // ======================================================= // File:helloworld.cpp // Author:Vana Doufexi // Date:1/4/2006 // Description:Displays.
Chapter 2 part #1 C++ Program Structure
DOCUMENTATION SECTION GLOBAL DECLARATION SECTION
Agenda Computer Languages How to Write a Simple C Program
Introduction to C++.  Computers: CPU, Memory & Input / Output (IO)  Program: Sequence of instructions for the computer.  Operating system: Program.
 2007 Pearson Education, Inc. All rights reserved. A Simple C Program 1 /* ************************************************* *** Program: hello_world.
Print Row Function void PrintRow(float x[ ][4],int i) { int j; for(j=0;j
Objective Write simple computer program in C++ Use simple Output statements Become familiar with fundamental data types.
1 Structure of Simple C++ Program Chapter 1 09/09/13.
1 C Syntax and Semantics Dr. Sherif Mohamed Tawfik Lecture Two.
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
2.1 First C Program. First Program Open visual studio, click new file Save as “programName.c” – Program must start with letter and have no spaces – Must.
Lecture 4 Computer Programming // sample C++ program #include using namespace std; int main() { cout
STRUCTURED PROGRAMMING Complete C++ Program. Content 2  Main Function  Preprocessor directives  User comments  Escape characters  cout statement.
Introduction to C Topics Compilation Using the gcc Compiler
Computer Programming Your First Java Program: HelloWorld.java.
CSCE 206 Structured Programming in C
Programming what is C++
ANNOUNCEMENT The missed lecture will be made up this Monday evening in the Tech PC classroom (MG51). A tentative time interval is 6:30-8:00. The exact.
CSC201: Computer Programming
CSE 220 – C Programming C Fundamentals.
Introduction to C Language
Chapter 2 - Introduction to C Programming
Computer Programming Chapter 1: Introduction
Chapter 2, Part I Introduction to C Programming
Introduction to C Language
Chapter 2 - Introduction to C Programming
Intro to Java.
2011/11/20: Lecture 15 CMSC 104, Section 4 Richard Chang
Chapter 2 - Introduction to C Programming
Chapter 2 - Introduction to C Programming
Introduction to CS Your First C Programs
Functions I Creating a programming with small logical units of code.
مباني كامپيوتر و برنامه سازي
Chapter 2 - Introduction to C Programming
Computer Electronic device Accepts data - input
Functions, Part 1 of 3 Topics Using Predefined Functions
Fundamentals of Programming
Govt. Polytechnic,Dhangar
Computer Electronic device Accepts data - input
Chapter 2 - Introduction to C Programming
Programming Fundamentals Lecture #3 Overview of Computer Programming
Functions, Part 1 of 3 Topics Using Predefined Functions
Chapter 2 - Introduction to C Programming
Functions, Part 1 of 3 Topics Using Predefined Functions
Introduction to Programming - 1
Introduction to C Topics Compilation Using the gcc Compiler
EECE.2160 ECE Application Programming
Functions I Creating a programming with small logical units of code.
Compile and run c files.
Chapter 2 part #1 C++ Program Structure
Presentation transcript:

Computer Programming

A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return 0; }

A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return 0; } This is a comment comments help explain the program to someone they are ignored by the computer

A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return 0; } This is an instruction to the compiler to insert the contents of a file named “stdio.h” into the program supplies useful information for the compiler

A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return 0; } This tells the compiler we’re about to define a function, named main main is a special function; it is where your program starts running

A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n” ); return 0; } This is a C statement This statement calls a function named printf It causes the text to be printed on the screen