0% found this document useful (0 votes)
35 views1 page

C Programming Basics: Hello World Example

The document discusses the basic "Hello World" C program and common data types and functions used. It introduces the main() function, printf() function, and file extensions used for C programs. It also describes various format specifiers like %d, %f, %c that can be used with printf() to output different data types. Finally, it mentions preprocessor directives, escape sequences, and macro constants that are fundamental aspects of the C programming language.

Uploaded by

Lester Ganotisi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views1 page

C Programming Basics: Hello World Example

The document discusses the basic "Hello World" C program and common data types and functions used. It introduces the main() function, printf() function, and file extensions used for C programs. It also describes various format specifiers like %d, %f, %c that can be used with printf() to output different data types. Finally, it mentions preprocessor directives, escape sequences, and macro constants that are fundamental aspects of the C programming language.

Uploaded by

Lester Ganotisi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Hello World - The first program write.

In C , the program to print “hello , world” is


#include <stdio.h>
Main()
{
Printf(“Hello world\n ”);
}
.C – The file name ends.
Example: hello.c

C Function – are like the subroutines and functions.


Fortran - the procedures and functions of Pascal.
Main – will usually call other functions to help perform
its job.
\n – escape sequence.
\t – tab
\b – backspace
\” – double quote
\\ - backslash.
Comment – this case explains briefly what the program
does.
Int – Integers
Float – floating point
Char – characters –a single byte
Short – short integer
Long – long integer
Double – double – precision floating point

Print as:
%d – decimal integer.
%6d – as decimal integer at least 6 characters wide
%f – floating point.
%6f - as floating point at least 6 characters wide
%.2f- as floating point 2 characters after decimal point
%6.2f- as floating point at least 6 wide and 2 after
decimal point.
%o – for octal
%x – hexadecimal
%c – character
%s – character string
%% - itself.

Symbols constant:
Name – the same form as a variable name
Replacement text – can be any sequence of characters.
Text stream – is a sequence of characters divided into
line.

You might also like