Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Data science

Rating
-
Sold
-
Pages
48
Uploaded on
26-02-2023
Written in
2022/2023

This is a notes of data science 1st part.

Institution
Course

Content preview

CS3251 Programming in C Department of IT

UNIT I BASICS OF C PROGRAMMING

Introduction to programming paradigms - Structure of C program - C programming: Data Types
– Storage classes - Constants – Enumeration Constants - Keywords – Operators: Precedence and
Associativity - Expressions - Input/Output statements, Assignment statements – Decision making
statements - Switch statement - Looping statements – Pre-processor directives - Compilation
process

1.1 Introduction to programming paradigms

The programming language „C‟ was developed in the early 1970s by Dennis Ritchie at Bell
Laboratories. Although C was initially developed for writing system software, today it has become
such a popular language that a variety of software programs are written using this language. The
greatest advantage of using C for programming is that it can be easily used on different types of
computers. Many other programming languages such as C++ and Java are also based on C which
means that you will be able to learn them easily in the future. Today, C is widely used with the
UNIX operating system.


Programming Languages
The purpose of using computers is to solve problems, which are difficult to solve manually. So the
computer user must concentrate on the development of good algorithms for solving problems.
After preparing the algorithms, the programmer or user has to concentrate the programming
language which is understandable by the computer.
Computer programming languages are developed with the primary objectives of facilitating a large
number of people to use computer without the need to know the details of internal structure of the
computer.


1.2 Structure of C program
A C program contains one or more functions, where a function is defined as a group of statements
that perform a well-defined task. Figure 1.1 shows the structure of a C program. The statements in
a function are written in a logical sequence to perform a specific task. The main() function is the
most important function and is a part of every C program. Rather, the execution of a C program
begins with this function.
JEPPIAAR INSTITUTE OF TECHNOLOGY Page 1

,CS3251 Programming in C Department of IT

From the structure given in Fig. 1.1, we can conclude that a C program can have any number of
functions depending on the tasks that have to be performed, and each function can have any number
of statements arranged according to specific meaningful sequence. Note that programmers can
choose any name for functions. It is not mandatory to write Function1, Function2, etc., with an
exception that every program must contain one function that has its name as main().




Fig 1.1 Structure of C program




JEPPIAAR INSTITUTE OF TECHNOLOGY Page 2

,CS3251 Programming in C Department of IT

1.3 C Programming : Data Types
Data type determines the set of values that a data item can take and the operations that can
beperformed on the item. C language provides four basic data types. Table 1.2 lists the data types,
their size, range, and usage for a C programmer.




Basic Data Types in C




Basic data types and their variants
1.4 Constants
A constant is an entity whose value can‟t be changed during the execution of a program.
Constants are classified as:
1. Literal constants
2. Qualified constants
3. Symbolic constants




JEPPIAAR INSTITUTE OF TECHNOLOGY Page 3

, CS3251 Programming in C Department of IT

1.5.1 Literal constants
Literal constant or just literal denotes a fixed value, which may be an integer, floating point
number, character or a string.
Literal constants are of the following types.
1. Integer Literal constant
2. Floating point Literal constant
3. Character Literal constant
4. String Literal constant


Integer Literal constant
Integer Literal constants are integer values like -1, 2, 8 etc. The rules for writing integer literal
constant are:
• An Integer Literal constant must have at least one digit
• It should not have any decimal point It can be either positive or
negative.
• No special characters and blank spaces are allowed.
• A number without a sign is assumed as positive.
• Octal constants start with 0.
• Hexadecimal constant start with 0x or 0X
Floating point Literal constant
Floating point Literal constants are values like -23.1, 12.8, 4e8 etc.. It can be written in a fractional
form or in an exponential form.
The rules for writing Floating point Literal constants in a fractional form:
• A fractional floating point Literal constant must have at least one digit.
• It should have a decimal point.
• It can be either positive or negative. No special characters and blank spaces are
allowed.


The rules for writing Floating point Literal constants in an exponential form:
• A Floating point Literal constants in an exponential form has two parts: the mantissa part
and the exponent part. Both are separated by e or E.


JEPPIAAR INSTITUTE OF TECHNOLOGY Page 4

Written for

Course

Document information

Uploaded on
February 26, 2023
Number of pages
48
Written in
2022/2023
Type
Class notes
Professor(s)
Karthik
Contains
All classes

Subjects

$9.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
iamgopinath

Get to know the seller

Seller avatar
iamgopinath Jeppiaar institute of technology
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
1
Last sold
-
Knowledge Factory

Here\'s the notes of information technology part and digital subject notes.

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 tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

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

Student with book image

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

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions