Programming ENGG1035: PA Res, Wilfredo G. STUB 1970
Programming ENGG1035: PA Res, Wilfredo G. STUB 1970
#include<studio.h> Library
DATATYPES main() Main function
There are five atomic data types in C: character, integer,
{ Left curly bracket or brace
floating point, double floating point, and valueless
TYPE BIT WIDTH RANGE Printf(“Hello World\n”);
Char 8 0-255 } Right curly bracket or brace
int 16 -32768 to 32767
Source Code - the text of a program that user can read;
float 32 3.4E-38 to 3.4E+38 commonly thought of as the program. The source code is a
double 64 1.7E-308 to 1.7E+308 input into a compiler.
void 0 valueless Linker - a program that links separately compiled functions
together into one program. It combines the functions in the
OPERATORS standard C library with the code that you wrote. The output of
Logical Manipulation the linker is an executable program.
Code Meaning
\b Backspace Library - the file containing the standard functions that can be
used by your program. These functions include all I/O
\f Form feed operations as well as other useful routines.
\n Newline
Compile Time - the even that occur while your program is
\r Carriage return being compiled. A common occurrence during compile time is
a syntax error.
\t Horizontal tab
\” Double quote
Display sum
Function Purpose
Name/Example
print(“text”) To display information on the screen
scanf(“%d”,%i) Used to read information from
keyboard
Display Manipulation
%d Integer( whole number)
%f Float
%.2f Float w/ 2 decimal space
%s String
%c Character
#include<stdio.h>
void main()
{
char name[20]
Int age;