100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Class notes

Introduction to c language

Rating
-
Sold
-
Pages
47
Uploaded on
25-03-2023
Written in
2022/2023

in detail gives a brief introduction to c language

Institution
Course











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Course

Document information

Uploaded on
March 25, 2023
Number of pages
47
Written in
2022/2023
Type
Class notes
Professor(s)
Dr karthik
Contains
All classes

Subjects

Content preview

MODULE 1
INTRODUCTION TO C LANGUAGE
Syllabus

 Pseudo code Solution to Problem
 Basic Concepts of C Program
 Declaration, Assignment & Print Statements
 Data Types
 Operators and Expressions
 Programming Examples and Exercise.
Introduction to C
 C is a general-purpose programming language developed by Dennis Ritchie at AT&T
Bell laboratories in 1972.
Advantages/Features of C Language
C language is very popular language because of the following features:
1. C is structured Programming Language
2. It is considered a high-level language because it allows the programmer to solve a
problem without worrying about machine details.
3. It has wide variety of operators using which a program can be written easily to solve a
given problem.
4. C is more efficient which increases the speed of execution and management of
memory compared to low level languages.
5. C is machine independent. The program written on one machine will work on another
machine.
6. C can be executed on many different hardware platforms.
Pseudocode: A solution to Problem
 Definition:
 It is a series of steps to solve a given problem written using a mixture of English and
C language.
 It acts as a problem solving tool.
 It is the first step in writing a program.

,  Purpose:
 Is to express solution to a given problem using mixture of English language
and c like code.
 Advantage:
 Easy to write and understand
 It is relatively easy to convert English description solution of small programs to C
program.
Ex 1: Addition of two numbers
1. Get the numbers[a,b]
2. Compute addition [Sum= a + b]
3. Print the results [Sum]
Ex 2: Area of Circle
1. Get the radius[r]
2. Compute area[Area = 3.141*r*r]
3. Print the results [Area]
Disadvantage:
 It is very difficult to translate the solution of lengthy and complex problem in English to
C


C Programming Concepts
 Program: A program is a group of instructions given by the programmer to perform a
specific task.
Character set of C language
 Definition: A symbol that is used while writing a program is called a character.
 A character can be: .
 Alphabets/Letters (Lowercase a-z, Uppercase A-Z)
 Digits (0-9)
 Special Symbols ( ~ ‘ ! @ # % & * () - + / $ = \ {
 } [ ] : ; “ “ ? etc)

, Symbol Name Symbol Name Symbol Name

~ | [
Tilde Vertical bar Left bracket

# hash ( Left parenthesis ]
Right bracket

$ Dollar sign ) Right parenthesis
: Colon

% Percent sign _ Underscore ” Quotation
mark

^ + Plus sign ;
Caret Semicolon

& Ampersand { <
Left brace Less than

* Asterisk } Greater than
Right brace >

Assignment
‘ Single quote . dot =

Division
, comma \ backslash /




C Tokens
 Tokens are the smallest or basic units of C program.
 One or more characters are grouped in sequence to form meaningful words.these
meaningful words are called as tokens.
 A token is collection of characters.
 Tokens are classified in to 5 types as below:

, Keywords
 The tokens which have predefined meaning in C language are called keywords.
 They are reserved for specific purpose in C language they are called as Reserved
Words.
 There are totally 32 keywords supported in C they are:
auto double if static
break else int struct
case enum long switch
char extern near typedef
const float register union
continue for return unsigned
default volatile short void
do goto signed while


Rules for keywords
1. Keywords should not be used as variables ,function names, array names etc.
2. All keywords should be written in lowercase letters.
3. Keywords meaning cannot be changed by the users.
Identifiers
Definition:
 Identifiers are the names given to program elements such as variables, constants ,function
names, array names etc
 It consists of one or more letters or digits or underscore.
Rules for identifiers
1. The First character should be an alphabet or an underscore _
Then First character is followed by any number of letters or digits.
R138,86
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
hemantkumar1

Document also available in package deal

Get to know the seller

Seller avatar
hemantkumar1 nmit
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
2 year
Number of followers
0
Documents
7
Last sold
-

0,0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions