1 Module1
1 Module1
C K Marigowda | Associate Professor & HOD | Information Science & Engineering | Acharya Institute of Technology | [email protected]
C K Marigowda - a brief profile
Responsibility
- Head of Information Science and Engineering
- Deputy Director- International Collaborations
- Dean - Alumni Affairs
- SPoC- Infosys Campus Connect
Education and Research:
- Received Bachelor and Masters in Computer Science from PES
- Pursuing Ph.D. in the field of Security in IoT.
- Research interests include Problem solving techniques, Information and Cyber
Security. Security in IoT and Data Science
Accord:
- Establish tie-ups with various international universities
- Coordinating the activities of Alumni Association at Acharya responsible for
coordination of international alumni meets across US and Europe.
- A recipient of Infosys Faculty Excellence award during 2016 from Infosys Ltd.,
Bangalore.
- Research work has published as an article in Cyber Space edition of DECCAN HERALD news paper.
- Member of NAFSA: Association of International Educators, USA
- Mentor for a startup AnyGo - Fitness Aggregator
- Delivered a session on Cyber Security in more than 10 universities in Indonesia.
- Participated in NAFSA 2017 and 2018– Annual Conference & Expo at Los Angeles, and Philadelphia, PA USA
respectively.
Countries Visited as part of International Collaborations
Chicago, California San Jose, LA, New York, Philidelphia, USA, France, Budapest, Hungary, Milan, Italy,
Switzerland, Alicante, Spain
Core Competencies:
Training & Academic Administration, Strategic Planning, Curriculum Development, Establishing tie-ups with
international universities, Start-ups development, Mentoring, Alumni Networking strategy.
The Crisis of Educated Unemployed
Industrial Evolution
4. Industrial
revolution
Based on cyber-physical-
systems
3. Industrial revolution
Through the use of electronics Industry 4.0
and IT further progression in
autonomous production Today
Level of complexity
2. Industrial revolution Industry 3.0
Introducing mass production
lines powered by electric
energy
1. Industrial revolution Industry 2.0 Beginning of the
Introducing mechanical
Beginning of the 70th
production machines powered
by water and steam 20th century
Industry 1.0
End of the 18th century.
Source: DFKI/Bauer IAO
Building Blocks of Industry 4.0
Top 10 skills to be relevant in Industry 4.0
Syllabus
Syllabus
Course Outcomes (CO’s):
CO2: Design the solution for the given problems and develop the same using C programming
language
CO3: Apply the concepts of looping, branching, and decision-making statements for a given
problem
CO4: Demonstrate the ability to write C programs using pointers, structures, unions and arrays
C, Computer
Programming Language
developed in the early
1970s by American
computer scientist
Dennis M. Ritchie at Bell
Laboratories (formerly
AT&T Bell Laboratories)
C Programming Language has following importance:
1.C is robust language and has rich set of built-in functions, data
types and operators which can be used to write any complex
program
2. C has the capabilities of an assembly language (low level
features) with the feature of high level language so it is well suited
for writing both system software and application software
3.C is highly portable language i.e. code written in one machine
can be moved to other which is very important and powerful
feature.
4.C supports low level features like bit level programming and direct
access to memory using pointer which is very useful for managing
resource efficiently.
5.C has high level constructs and it is more user friendly as its
syntaxes approaches to English like language.
Use of C Programming
Database systems
Graphics packages
Word processors
Spread sheets
Operating system
development
Compilers and
Assemblers
Network drivers
Interpreters
Application Software V/S System Software
Department of Information Science & Engineering
Acharya Institute of Technology
Module-1
Overview of C
C K Marigowda | Associate Professor & HOD | Information Science & Engineering | Acharya Institute of Technology | [email protected]
Content
Executing a C Program
C Tokens
Data types
void main( )
{
printf("Area of circle = %f", area(r));
}
float area( )
{
return PI*r*r ;
}
Source Code v/s Executable Code
Content
Executing a C Program
C Tokens
Data types
Executing a C Program
C Tokens
Data types
Constant The constants refer to fixed values that the program may not alter during its
execution (int, float, char, string values)
Ex: pi=3.14, a=5 ….
Identifier A C identifier is a name used to identify a variable, function, or any other
user-defined item. Ex: sum, a, b, area( ), …..
Variables Variables are simply names used to refer to some location in memory
Ex: sum, a, b …..
String Sequence of characters Ex: “Acharya” …..
Special Symbol Symbols other than the Alphabets and Digits and white-spaces
Ex: @ , { , ) , [ , #, …..
Executing a C Program
C Tokens
Data types
Integer Constant
Decimal(0-9) :100,-67,989 etc.,
Octal ( 0-7 with a prefix 0) :010,0777,-065 etc.,
Hexadecimal (0-9 along with A-F) :0XAB, 0XA123 etc.,
int abc;
float _abc;
int abc12;
Executing a C Program
C Tokens
Data types
The data type defines the type of data stored in memory location.
It determines how much memory should be allocated for a variable
associated with the data type
Format Specifier
Data Type Keyword Memory Range for input / output
0 to 216 – 1
0 to 65535 (unsigned)
Integer int 2 bytes
-215 to + 215 -1
%d
0 to 28 - 1
1 byte 0 to 255 (unsigned)
Character char %c
-27 to + 27 -1
-128 to 127 (signed)
floating point float 4 bytes 3.4 E -38 to 3.4 E +38 %f
Double precision 1.7 E -308 to 1.7 E +308
double 8 bytes %lf
floating point
Variables
A variable is a name given to the memory location where the data
can be stored. Using this name the data can be further accessed or
manipulated easily
The following is the general syntax for declaring variables
data type var1, var2, var3,........, varn;
Example:
int a, b, c; // declaration of 3 integer variables
float x, y; // declaration of 2 floating point variables
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013
GV GV GV GV GV
Variables
Declaration of variables will only allocate memory, however, the
contents inside the memory will be unknown values (also referred to as
garbage values).
a b c x y
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013
20 100 GV 3.14 GV
Content
Executing a C Program
C Tokens
Data types
Output functions retrieve the data from memory locations and send
them to output devices (monitor, printer).
Example: printf(),putchar(), puts() etc.
1) printf( ) function
printf( ) can be used to print only text or text with values
scanf( ) function
To read values
- Write the format specifiers within double quotes, followed by a
comma, followed by the address of variables separated by comma
inside scanf
EX: scanf(“%d %d %f”, &a, &b, &c);
third variable
Content
Executing a C Program
C Tokens
Data types
- Special Operators
- comma ( , ), sizeof( ) etc
Operators
Examples:
3>2 //Output 1 2>5 //Output 0 2==2 //Output 1
3==4 //Output 0 3>=4 //Output 0 3<=4 //Output 1
Relational Operators