0% found this document useful (0 votes)
11 views

Small Business Web Site Project Proposal by Slidesgo

C was developed in the 1970s at Bell Labs and became widely popular for its portability and ability to access hardware; it is a high-level language used for systems programming and as an intermediate language by other compilers, with characteristics like small size, structured programming, and support for pointers, arrays, and structures. The structure of a C program includes preprocessor directives, global variable and function declarations, a main() function definition, other function definitions, and the ability to call functions and compile, link, and execute the program across different operating systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Small Business Web Site Project Proposal by Slidesgo

C was developed in the 1970s at Bell Labs and became widely popular for its portability and ability to access hardware; it is a high-level language used for systems programming and as an intermediate language by other compilers, with characteristics like small size, structured programming, and support for pointers, arrays, and structures. The structure of a C program includes preprocessor directives, global variable and function declarations, a main() function definition, other function definitions, and the ability to call functions and compile, link, and execute the program across different operating systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 81

Chapter 9

Introduction to C
Here is where your presentation begins
Chapter 9
Introduction to C
Introduction
● C was developed in the early 1970s by Dennis Ritchie at Bell Laboratories
● C also supports the concept of data types.
● C was initially developed for writing system software
● Since UNIX operating system was also developed at Bell Laboratories along with C
language, C and UNIX are strongly associated with each other.
● American National Standards Institute (ANSI) started working on defining the standard
for C. This standard was approved in December 1989 and came to be known as ANSI C.
● Today, C has become a popular language and various software programs are written using
this language.
● Many other commonly used programming languages such as C++ and Java are also based
on C
Introduction
Characteristics of C
● C is a high-level programming language, which enables the programmer to concentrate on
the problem at hand and not worry about the machine code on which the program would
be run.
● Small size-C has only 32 keywords. This makes it relatively easy to learn as compared to
other languages.
● C makes extensive use of function calls.
● C is well suited for structured programming. In this programming approach, C enables
users to think of a problem in terms of functions/modules where the collection of all the
modules makes up a complete program. This feature facilitates ease in program debugging,
testing, and maintenance.
● Unlike PASCAL it supports loose typing (as a character can be treated as an integer and vice
versa).
● Structured language as the code can be organized as a collection of one or more functions.
● Stable language. ANSI C was created in 1983 and since then it has not been revised.
Characteristics of C
● Quick language as a well written C program is likely to be as quick as or quicker than a
program written in any other language. Since C programs make use of operators and data
types, they are fast and efficient. For example, a program written to increment a value from
0-15000 using BASIC would take 50 seconds whereas a C program would do the same in
just I second.
● Facilitates low level (bitwise) programming.
● Supports pointers to refer computer memory, arrays, structures, and functions.
● Core language. C is a core language as many other programming languages (like C++, Java,
Perl, etc.) are based on C. If you know C, learning other computer languages becomes much
easier.
● C is a portable language, i.e., a C program written for one computer can be run on another
computer with little or no modification.
● C is an extensible language as it enables the user to add his own functions to the C library.
● C is often treated as the second best language for any given programming task. While
the best language depends on the particular task to be perfomed. the second best language, on
the other hand, will always be C.
Uses of C
● C language is primarily used for system programming. The portability, efficiency, the
ability to access specific hardware addresses and low runtime demand on system resources
makes it a good choice for implementing operating systems and embedded system
applications.
● C has been so widely accepted by professionals that compilers, libraries, and
interpreters of other programming languages are often implemented in C.
● For portability and convenience reasons, C is sometimes used as an intermediate
language by implementations of other languages. Example of compilers which use C
this way are BitC, Gambit, the Glasgow Haskell Compiler, Squeak, and Vala.
● C is widely used to implement end-user applications
Structure of a c program
● A C program is composed of, 1 #include<stdio.h>
#define MAX
1. Pre processor directives
2. Declaration of global variables 2 //Global variables
3. Declaration of function prototypes //Function prototypes
3
4. Definition of main() function Function1();
5. Definition of functions main()
4
{
Statement 1;
Statement 2;
……………
……………
Statement N;
}
Function1()
5
{
Statement 1;
Statement 2;
……………
……………
Statement N;
}
My first C program
// This is my first program in C

1 #include<stdio.h>
int main()
4 {
printf("\n Welcome to the world of C ");
return 0;
}
My second C program
// This is my second program in 5 int add(int a, int b)
1
C {
#include<stdio.h> int temp;
2
int c; temp = a + b;
3 int add(int,int); return temp;
4 int main()
{ }
int a,b;
printf(“\n Enter two
numbers:”);
scanf(“%d %d”,&a, &b);
c = add(a,b);
printf("\n C = %d “,c);
return 0;
}
Commands
1. Edit program
○ Use editor & type program

2. Save program
○ Save program with .c extension

3. Compile program
○ $ gcc – o myfirstprog myfirstprog.c

4. Execute
○ $ ./ myfirstprog
Files used in a C program
Files in a C
program

Source Header Object Executable


File File File File

Source code file


● It contains the source code of the program.
● File extension of any C source code file is “.c”.
● It contains C source code that defines the main function and maybe other functions.
● The main() is the starting point of execution when you successfully compile and run the
program.
● A C program in general may include even other source code files (with the file extension .c).
Files used in a C program
Header Files
● When working with large projects, it is often desirable to make sub-routines and store them
in a different file known as header file.
● The advantage of header files can be realized when
a) The programmer wants to use the same subroutines in different programs.
b) The programmer wants to change, or add, subroutines, and have those changes be reflected
in all other programs.
● Conventionally, header files names ends with a “.h” extension and its name can use only
letters, digits, dashes, and underscores.
● While some standard header files are available in C, but the programmer may also create his
own user defined header files
Files used in a C program
Object Files
● Object files are generated by the compiler as a result of processing the source code file.
● Object files contain compact binary code of the function definitions.
● Linker uses this object file to produce an executable file (.exe file) by combining the of
object files together.
● Object files have a “.o” extension, although some operating systems including Windows and
MS-DOS have a “.obj” extension for the object file.

Binary Executable File


● The binary executable file is generated by the linker.
● The linker links the various object files to produce a binary file that can be directly executed.
● On Windows operating system, the executable files have “.exe” extension.
Compiling and executing c programs
● The compilation process in the figure 2.5 is done in two steps.
● In the first step, the preprocessor program reads the source file as text, and produces another
text file as output.
● Source code lines which begin with the hash symbol are actually not written in C but in the
preprocessor language.
● The output of the preprocessor is a text file which does not contain any preprocessor
statements.
● This file is ready to be processed by the compiler.
● The linker combines the object file with library routines (supplied with the compiler) to
produce the final executable file.
Source File Pre- Compiler Object
proces Files
s
Library Library Linker Executable
Files Files Files

Source File Pre- Compiler Object


proces Files
s
Library
Using comments
● It is a good programming practice to place some comments in the code to help the reader
understand the code clearly.
● Comments are just a way of explaining what a program does.
● It is merely an internal program documentation.
● The compiler ignores the comments when forming the object file.
● This means that the comments are non-executable statements.
C supports two types of commenting.
● // is used to comment a single statement.
● This is known as a line comment.
● A line comment can be placed anywhere on the line and it does not require to be specifically
ended as the end of the line automatically ends the line.
● /* is used to comment multiple statements.
● A /* is ended with */ and all statements that lie within these characters are commented.
Keywords
● C has a set of 32 reserved words often known as keywords.
● All keywords are basically a sequence of characters that have a fixed meaning.
● By convention all keywords must be written in lowercase (small) letters.
● Example:
● for,
● while, • struct,
• enum,
● do-while, • switch,
• extern,
● auto • typedef,
• float,
● break, • union,
• goto,
● case, • unsigned,
• if,
● char, • void,
• int,
● continue, • volatile
• long,
● do, double,
• register,
● else,
• return,
• short,
• signed,
• sizeof,
• static,
Data types in C
SIZE SIZE
DATA TYPE IN RANGE DATA TYPE IN RANGE
BYTES BYTES
char 1 -128 to 127 short int 2 -32768 to 32767

unsigned 0 to 255 unsigned short 0 to 65535


char 1 int 2

signed char -128 to 127 long int -2147483648 to 2147483647


1 4

int -32768 to 32767 unsigned long 0 to 4294967295


2 int 4

unsigned int 0 to 65535 signed long int -2147483648 to 2147483647


2 4

signed short -32768 to 32767 float 3.4E-38 to 3.4E+38


int 2 4

signed int 2 -32768 to 32767 double 8 1.7E-308 to 1.7E+308

long double 10 3.4E-4932 to 1.1E+4932


Identifiers
● Identifiers are names given to program elements such as variables, arrays and functions.
Rules for forming identifier name
 It cannot include any special characters or punctuation marks (like #, $, ^, ?, ., etc) except the
underscore"_".
 There cannot be two successive underscores
 Keywords cannot be used as identifiers
 The names are case sensitive.
So, example, “FIRST” is different from “first” and “First”.
 It must begin with an alphabet or an underscore.
 It can be of any reasonable length. Though it should not contain more than 31 characters.
Example: roll_number, marks, name, emp_number, basic_pay, HRA, DA, dept_code
Identifiers
● A variable is defined as a meaningful name given to the data storage location in computer
memory.
● When using a variable, we actually refer to address of the memory where the data is stored.
● C language supports two basic kinds of variables.
● Numeric variables can be used to store either integer values or floating point values.
● While an integer value is a whole numbers without a fraction part or decimal point, a floating
point number, can have a decimal point in them.
● Numeric values may also be associated with modifiers like short, long, signed and unsigned.
● By default, C automatically a numeric variable signed.
● Character variables can include any letter from the alphabet or from the ASCII chart and
numbers 0 – 9 that are put between single quotes.
Identifiers
● To declare a variable specify data type of the variable followed by its name.
● Variable names should always be meaningful and must reflect the purpose of their usage in
the program.
● Variable declaration always ends with a semicolon.
● Example,
● int emp_num;
● float salary;
● char grade;
● double balance_amount;
● unsigned short int acc_no;

Variables

Numeric Variable Character Variables


Constants
● Constants are identifiers whose value does not change.
● Constants are used to define fixed values like PI or the charge on an electron so that their
value does not get changed in the program even by mistake.
● To declare a constant, precede the normal variable declaration with const keyword and assign
it a value.
● For example,
const float pi = 3.14;
● Another way to designate a constant is to use the pre-processor command define.
#define PI 3.14159
● When the preprocessor reformats the program to be compiled by the compiler, it replaces
each defined name with its corresponding value wherever it is found in the source program.
● Hence, it just works like the Find and Replace command available in a text editor.
Constants
Rules that needs to be applied to a #define statement which defines a constant.
● Constant names are usually written in capital letters to visually distinguish them from other
variable names which are normally written in lower case characters.
● Note that this is just a convention and not a rule.
● No blank spaces are permitted in between the # symbol and define keyword
● Blank space must be used between #define and constant name and between constant name
and constant value
● #define is a pre-processor compiler directive and not a statement.
● Therefore, it does not end with a semi-colon.
Streams
● A stream acts in two ways.
● It is the source of data as well as the destination of data.
● C programs input data and output data from a stream.
● Streams are associated with a physical device such as the monitor or with a file stored on the
secondary memory.
● In a text stream, sequence of characters is divided into lines with each line being terminated
with a new-line character (\n).
● On the other hand, a binary stream contains data values using their memory representation.
● Although, we can do input/output from the keyboard/monitor or from any file but in this
chapter we will assume that the source of data is the keyboard and destination of the data is
the monitor.

Streams in a C program
Keyboar Data
d

Monitor Data
Text Stream Binary Stream
The printf() function
● The printf function is used to display information required to the user and also prints the
values of the variables.
● Its syntax can be given as
printf (“control string”, variable list);
● The parameter control string is a C string that contains the text that has to be written on to the
standard output device.
● The prototype of the control string can be given as below
%[flags][width][.precision][length]specifier

flag description
- Left-justify within the data given field width
+ Displays the data with its numeric sign (either + or -)
Used to provide additional specifiers like o, x, X, 0, 0x or
# 0X for octal and hexa decimal values respectively for
values different than zero.
The number is left-padded with zeroes (0) instead of
0
spaces
The printf() function
● The printf function is used to display information required to the user and also prints the
values of the variables.
● Its syntax can be given as
printf (“conversion string”, variable list);
● The parameter control string is a C string that contains the text that has to be written on to the
standard output device.
● The prototype of the control string can be given as below
%[flags][width][.precision][length]specifier

length Description
h When the argument is a short int or unsigned short int.
When the argument is a long int or unsigned long int for
l
integer specifiers.
When the argument is a long double (used for floating
L
point specifiers)
The printf() function
● The prototype of the control string can be given as below
%[flags][width][.precision][length]specifier

specifier Qualifying Input


c For single character
d For decimal values
F For floating point numbers
E, e Floating point numbers in exponential format
G, G Floating point numbers in the shorter of e format
o For Octal number.
s For a sequence of (string of) characters
u For Unsigned decimal value
x,X For Hexadecimal value.
The scanf() function
● The scanf() is used to read formatted data from the keyboard.
● The syntax of the scanf() can be given as,
scanf (“control string”, arg1, arg2, ………….argn);
● The control string specifies the type and format of the data that has to be obtained from the
keyboard and stored in the memory locations pointed by the arguments arg1, arg2,…, argn.
● The prototype of the control string can be give as:
[=%[*][width][modifiers]type=]
● * is an optional argument that suppresses assignment of the input field.
● That is, it indicates that data should be read from the stream but ignored (not stored in the
memory location).
● width is an optional argument that specifies the maximum number of characters to be read.
● modifiers is an optional argument that can be h, l or L for the data pointed by the
corresponding additional arguments.
● Modifier h is used for short int or unsigned short int,
● l is used for long int, unsigned long int or double values.
● Finally, L is used long double data values.
● Type is same as specifier in printf()
EXAMPLE OF printf() and scanf():
● int num;
● float fnum;
● char ch, str[10];
● double dnum;
● short snum;
● long int lnum;
● printf(“\n Enter the values : “);
● scanf("%d %f %c %s %e %hd %ld", &num, &fnum, &ch, str, &dnum, &snum, &lnum);
● printf("\n num = %d \n fnum = %.2f \n ch = %c \n str = %s \n dnum = %e \n snum = %hd \n
lnum = %ld", num, fnum, ch, str, dnum, snum, lnum);
CONTENTS OF THIS TEMPLATE
You can delete this slide when you’re done editing the presentation

Fonts To view this template correctly in PowerPoint, download and install the fonts we used

Used and alternative resources An assortment of graphic resources that are suitable for use in this presentation

Thanks slide You must keep it so that proper credits for our design are given

Colors All the colors used in this presentation

Icons and infographic resources These can be used in the template, and their size and color can be edited

Editable presentation theme You can edit the master slides easily. For more info, click here

For more info: You can visit our sister projects:


Slidesgo | Blog | FAQs Freepik | Flaticon | Storyset | Wepik | Videvo
TABLE OF
01 02
CONTENT ABOUT US BUDGET
S You can describe the topic
of the section here
You can describe the topic
of the section here

03 04
PROJECT TIMELINE
You can describe the topic You can describe the topic
of the section here of the section here
01
ABOUT US
You can enter a subtitle here if
you need it
OUR COMPANY
Do you know what helps you make your point
clear? Lists like this one:
● They’re simple
● You can organize your ideas clearly
● You’ll never forget to buy milk!

And the most important thing: the audience won’t


miss the point of your presentation
OUR TEAM

SUSAN TIMMY
JENNA DOE SMITH JIMMY
You can speak a bit about this You can speak a bit about this You can speak a bit about this
person here person here person here
NOW
Mercury is the closest planet to the
Sun and the smallest one in the Solar
System
This planet’s name has nothing to do
with the liquid metal, since Mercury
was named after the Roman
messenger god
FUTURE
Venus has a beautiful name and is the
second planet from the Sun.

It’s terribly hot, even hotter than


Mercury, and its atmosphere is
extremely poisonous
02
BUDGET
You can enter a subtitle here if
you need it
OUR PARTNERS

MERCURY VENUS MARS


It’s the closest planet to Venus is the second Mars is actually a very
the Sun planet from the Sun cold place

JUPITER SATURN NEPTUNE


Jupiter is the biggest It’s composed of It’s the farthest planet
planet of them all hydrogen and helium from the Sun
AWESOME
WORDS
150,000
Big numbers catch your audience’s attention
A PICTURE IS
WORTH A
THOUSAND WORDS
MAJOR REQUIREMENTS

MERCURY VENUS
It’s the closest planet to the Venus has a beautiful name
Sun and the smallest one in and is the second planet from
the Solar System the Sun
WHAT WE ARE WORKING ON

LAYOUT SEO
Venus is the second planet Jupiter is the biggest planet
from the Sun in the Solar System

AUDIENCE TESTING
Despite being red, Mars is a Saturn is a gas giant and has
cold place several rings
ABOUT THE PROJECT

GOALS SITEMAP TESTING


Mercury is the closest planet Venus has a beautiful name Despite being red, Mars is
to the Sun and the smallest of and is the second planet from actually a cold place. It’s full
them all the Sun of iron oxide dust
SNEAK
PEEK
You can replace the image on the
screen with your own work. Just
right-click on it and select
“Replace image”
76%
of American adults buy online

13%
of total value is traded online

57%
of people buy online once a month
PROJECT STAGES

STEP 03 STEP 04
Mercury is the closest planet Jupiter is the biggest planet
to the Sun in the Solar System

STEP 01 STEP 02
Venus is the second planet Neptune is the farthest planet
from the Sun from the Sun
PROJECT GOALS

GOAL 1 GOAL 2 GOAL 3

Mercury is the smallest Venus is the second planet Mars is actually a very cold
INFO planet of them all from the Sun place

BUDGET $2,500 $1,300 $1,700

DEADLINE March 11 July 1 September 26


“This is a quote, words full of
wisdom that someone important
said and can make the reader get
inspired.”
—SOMEONE FAMOUS
THIS IS A MAP
JUPITER
It’s the biggest planet in the
Solar System

VENUS
Venus is the second planet
from the Sun

SATURN
Saturn is a gas giant and has
several rings
TIMELINE
SEPTEMBER
Earth is the third planet
JANUARY from the Sun

Jupiter is the biggest


planet of them all
DECEMBER
Saturn is a gas giant and
MARCH has several rings

Mercury is quite a small


planet
BUDGET
PRODUCTS MARKETING
Despite being red, Mars Jupiter is the biggest
is a cold place planet of them all

DESIGN SEO/SEM
Mercury is the closest Venus is the second
planet to the Sun planet from the Sun

Follow the link in the graph to modify its data and then paste the new one here. For more info, click here
PREDICTED RESULTS

RESULTS 01
Jupiter is the biggest
planet of them all

RESULTS 02
Saturn is a gas giant with
several rings

Follow the link in the graph to modify its data and then paste the new one here. For more info, click here
THANKS!
Do you have any questions?
[email protected]
+91 620 421 838
yourwebsite.com

CREDITS: This presentation template was created by Slidesgo, and includes


icons by Flaticon and infographics & images by Freepik

Please keep this slide for attribution


ALTERNATIVE RESOURCES
Here’s an assortment of alternative resources whose style fits that of this template:

PHOTOS
● Close up on young business team working
● Close up business people in conference room
● Young businesswoman checking her tablet with copy space
● Young people working together in a startup company
● Close up business people handshake
RESOURCES
Did you like the resources on this template? Get them for free at our other websites:

PHOTOS
● Back view of woman working at desk
● High angle man working with tablet
● Portrait of smiley business woman with copy space
● Close up on young businesswoman
● Confident middle aged man portrait
● People brainstorming in a work meeting
● Female web designer with papers and notes in the office
● Medium shot man designing websites
● Front view of people having a meeting in the office

VECTORS
● Flat wifi zone concept with signal
Instructions for use
If you have a free account, in order to use this template, you must credit Slidesgo by keeping the Thanks slide. Please
refer to the next slide to read the instructions for premium users.

As a Free user, you are allowed to:


● Modify this template.
● Use it for both personal and commercial projects.

You are not allowed to:


● Sublicense, sell or rent any of Slidesgo Content (or a modified version of Slidesgo Content).
● Distribute Slidesgo Content unless it has been expressly authorized by Slidesgo.
● Include Slidesgo Content in an online or offline database or file.
● Offer Slidesgo templates (or modified versions of Slidesgo templates) for download.
● Acquire the copyright of Slidesgo Content.

For more information about editing slides, please read our FAQs or visit our blog:
https://slidesgo.com/faqs and https://slidesgo.com/slidesgo-school
Instructions for use (premium users)
As a Premium user, you can use this template without attributing Slidesgo or keeping the Thanks slide.

You are allowed to:


● Modify this template.
● Use it for both personal and commercial purposes.
● Hide or delete the “Thanks” slide and the mention to Slidesgo in the credits.
● Share this template in an editable format with people who are not part of your team.

You are not allowed to:


● Sublicense, sell or rent this Slidesgo Template (or a modified version of this Slidesgo Template).
● Distribute this Slidesgo Template (or a modified version of this Slidesgo Template) or include it in a database or in
any other product or service that offers downloadable images, icons or presentations that may be subject to
distribution or resale.
● Use any of the elements that are part of this Slidesgo Template in an isolated and separated way from this
Template.
● Register any of the elements that are part of this template as a trademark or logo, or register it as a work in an
intellectual property registry or similar.

For more information about editing slides, please read our FAQs or visit our blog:
https://slidesgo.com/faqs and https://slidesgo.com/slidesgo-school
Fonts & colors used
This presentation has been made using the following fonts:

Roboto Condensed
(https://fonts.google.com/specimen/Roboto+Condensed)

Roboto
(https://fonts.google.com/specimen/Roboto)

#200e74 #01539d #5c5c61 #fffff #5c3da4

#b24ebe #84b9ff #9a9aa0 #ececec #dbdbdb


Storyset
Create your Story with our illustrated concepts. Choose the style you like the most, edit its
colors, pick the background and layers you want to show and bring them to life with the
animator panel! It will boost your presentation. Check out how it works.

Pana Amico Bro Rafiki Cuate


Use our editable graphic resources...
You can easily resize these resources without losing quality. To change the color, just ungroup the resource and click on
the object you want to change. Then, click on the paint bucket and select the color you want. Group the resource again
when you’re done. You can also look for more infographics on Slidesgo.
JANUARY FEBRUARY MARCH APRIL MAY JUNE

PHASE 1

Task 1

Task 2

PHASE 2

Task 1

Task 2

JANUARY FEBRUARY MARCH APRIL

PHASE 1

Task 1

Task 2
...and our sets of editable icons
You can resize these icons without losing quality.
You can change the stroke and fill color; just select the icon and click on the paint bucket/pen.
In Google Slides, you can also use Flaticon’s extension, allowing you to customize and add even more icons.
Educational Icons Medical Icons
Business Icons Teamwork Icons
Help & Support Icons Avatar Icons
Creative Process Icons Performing Arts Icons
Nature Icons
SEO & Marketing Icons
Premium infographics

Text 1 Text 2 Text 3


“Mercury is the “Despite being red,
smallest planet in Mars is actually a
the Solar System” very cold place”

Add the title here 2016 2017 2018 2019 2020

“Venus is the
“Neptune is the “Saturn is a gas
second planet from
farthest planet from giant and has
the Sun and is
the Sun” several rings”
terribly hot”

Text 4 Text 5 Text 6


Premium infographics

75% “Despite being red,


Mars is actually a
very cold place”

75%
“Jupiter is the
TITLE 1 biggest planet in the
entire Solar System”

“Mercury is the
smallest planet in the
Solar System”
“Saturn is a gas
giant and has
several rings”
Premium Icons
Digital Marketing
Premium Icons
Online Learning
Premium Icons
Laboratory
Premium Icons
Goals & Results
Premium Icons
Infographic Elements

You might also like