/* a program to print Hello World */ - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

/* a program to print Hello World */

Description:

files are located in C lib. - h indicates a header file - stdio standard input output lib ... Compile the source file with a Borland C or C compiler. Assignment 1b ... – PowerPoint PPT presentation

Number of Views:65
Avg rating:3.0/5.0
Slides: 7
Provided by: Microcompu88
Category:

less

Transcript and Presenter's Notes

Title: /* a program to print Hello World */


1
A simple C program
/ a program to print Hello World / /

/ includeltstdio.hgt int main(void) printf(
Hello World \n ) return(0)
2
  • Comment lines
  • ignored by the compiler
  • can be placed any where

/ a program to print Hello World / /

/ includeltstdio.hgt int main(void)
- preprocessor directive begins with - lt gt
files are located in C lib. - h indicates a
header file - stdio standard input output lib
spaces are allowed between lines of code
  • declares the function main
  • every C program requires this

braces mark the beginning and end
of a block of code
3
Control string in quotation marks
May contain text and/or conversion specifiers
New line indicator Causes a skip to the next line
printf( Hello World \n ) return(0)
Ends execution of the program and returns
control to the operating system
4
Assignment 1 a
Write and run a program in C code to print a one
line wisdom expression such as what consumes
your mind will control your life . Compile the
source file with a Borland C or C compiler.
5
Assignment 1b
Type out the source file and the output for a
FORTRAN program that will produce the same
wisdom statement as in 1a.
6
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com