0% found this document useful (0 votes)
7 views29 pages

C Introduction

The document outlines fundamental concepts in computer hardware and software, focusing on programming basics, particularly in the C language. It covers the structure of C programs, types of programming languages, and the differences between system software and application software. Additionally, it provides an introduction to writing a simple C program, detailing its components and syntax.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views29 pages

C Introduction

The document outlines fundamental concepts in computer hardware and software, focusing on programming basics, particularly in the C language. It covers the structure of C programs, types of programming languages, and the differences between system software and application software. Additionally, it provides an introduction to writing a simple C program, detailing its components and syntax.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

PROBLEM SOLVING

AND PROGRAMMING
• Prepared by :
• Reniya Shajahan
• Assisstant Professor
• Centre For AI
MODULE I : Basics of Computer Hardware
and Software (7 hours)
• Basics of Computer Architecture: Processor, Memory, Input&
Output devices. Application Software & System software:
Compilers, interpreters, High level and low level languages,
Introduction to structured approach to programming, Flow chart,
Algorithms, Pseudo code (bubble sort, linear search - algorithms
and pseudocode).
MODULE II : Program Basics (8 hours)
• Basic structure of C program: Character set, Tokens, Identifiers in
C, Variables and Data Types, Constants, Console IO Operations,
printf and scanf. Operators and Expressions: Expressions and
Arithmetic Operators, Relational and Logical Operators,
Conditional operator, size of operator, Assignment operators and
Bitwise Operators, Operators Precedence. Control Flow
Statements: If Statement, Switch Statement, Unconditional
Branching using goto statement, While Loop, Do While Loop, For
Loop, Break and Continue statements.(Simple programs covering
control flow).
C Language
Introduction

• C is a general-purpose
procedural programming
language initially
developed by Dennis
Ritchie in 1972 at Bell
Laboratories of AT&T
Labs. It was mainly
created as a system
programming language
to write the UNIX
operating system.
• C is considered mother of all programming
languages as many later languages like Java,
PHP and JavaScript have borrowed
syntax/features directly or indirectly from the C.
• If a person learns C programming first, it helps to
learn any modern programming language as it
Why Learn provide a deeper understanding of the
fundamentals of programming and underlying
C? architecture of the operating system like pointers,
working with memory locations etc.
• C is widely used in operating systems,
embedded systems, compilers, databases,
networking, game engines, and real-time systems
for its efficiency to work in low resource
environment and hardware-level support.
Computer Languages

• Computer languages are the


languages through which a user can
communicate with a computer by
writing program instructions.
• Low-level language is the only language
that can be directly understood by the
computer. It is also known as Machine
Language.
Binary language is an example of a low-
Low-Level level language.
Language • Machine language consists of only two
(Machine symbols: 1 and 0. These binary digits
represent instructions that are executed
Language) directly by the computer’s hardware.
Since the instructions are written in binary
form, machine language is also referred to
as Machine Code.
• Middle-level language is a computer language in
which instructions are created using symbols
such as letters, digits, and special characters.
The most common example of a middle-level
language is Assembly Language.
Middle-Level • In assembly language, predefined symbolic
words called mnemonics are used to write
Language program instructions. These mnemonics
represent machine-level operations in a more
(Assembly readable form (for example, ADD, SUB, MOV).
Language) • However, the computer cannot directly
understand mnemonics. Therefore, a translator
program called an Assembler is used to convert
assembly language instructions into binary
machine code that the computer can execute.
• A high-level language is a computer language that
can be easily understood by users. High-level
languages are very similar to human languages
and follow a set of grammar rules, which makes
writing programs simple and readable.
• Every high-level language contains a set of
High-Level predefined words known as keywords and a set
of rules known as syntax, which are used to
Language create valid program instructions.
• High-level languages cannot be directly
understood by the computer. Therefore, they
must be converted into low-level (machine)
language. This conversion is done using a
compiler or an interpreter.
RAM vs ROM
• In a computer system, the software is
basically a set of instructions or
commands that tell a computer to do a
specific task that serves its users.
Software and • A software is not a physical thing like
its Types hardware, it rather makes the hardware
work as per user requirements by giving
instructions.
• Examples of software are MS-Word, MS-
Excel, PowerPoint and Web Browser
• System software is software that directly
operates the computer hardware and provides
the basic functionality to the users as well as to
the other software to operate smoothly.
• System software basically controls a computer’s
System internal functioning and also controls hardware
devices such as monitors, printers, and storage
Software devices, etc.
• It is like an interface between hardware and user
applications, it helps them to communicate with
each other because hardware understands
machine language(i.e. 1 or 0) whereas user
applications are work in human-readable
languages like English, Hindi, German, etc.
• Software that performs special functions
or provides functions that are much more
than the basic operation of the computer
is known as application software.
• Application software is designed to
Application perform a specific task for end-users. It is
Software a product or a program that is designed
only to fulfill end-users' requirements.
• Examples include word
processors, spreadsheets, database
management, inventory, payroll programs,
etc.
Difference Between System Software and
Application Software
Writing First
Program in C
Language

• This simple program


demonstrates the basic
structure of a C program. It
will also help us
understand the basic
syntax of a C program.
Structure of the C program
• 1. Header (#include <stdio.h>)
• It tells the computer to use built-in tools
needed for printing output on the screen.

• 2. Main Function (int main(void)


• This is where the program starts running.

• 3. Opening Curly Bracket ({)


• It shows the start of the program
instructions.
• 4. Comment (// This prints "Hello World")
• This is a note for humans to understand the code.
The computer ignores it.

• 5. Statement (printf("Hello World")


• This line prints text on the screen.

• 6. Return Statement (return 0;)


• It tells the computer that the program ended
successfully.
• 7. Closing Curly Bracket (})
• It shows the end of the program instructions.

You might also like