100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Introduction to c language $7.99   Add to cart

Class notes

Introduction to c language

 11 views  0 purchase
  • Course
  • Institution

in detail gives a brief introduction to c language

Preview 4 out of 47  pages

  • March 25, 2023
  • 47
  • 2022/2023
  • Class notes
  • Dr karthik
  • All classes
avatar-seller
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.

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller hemantkumar1. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $7.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

77254 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$7.99
  • (0)
  Add to cart