Programming in C

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 18

UNDERSTANDING

C PROGRAMMING

Name - Yashveer Singh Class - Computer


engg.(B)
Roll no. - 230040800135
1. Intro
Hello everyone, My name is Yashveer
. I am from Kaimari. I did my
schooling from THE ARYAN
SCHOOL,HISAR. My hobbies are
playing cricket.

➔ Cirtification
I did my digital training from
Hartron centre in C programming

➔ Work experience
The work space was good and our
teacher was polite. He explained all
Concepts very neatly.
I completed my training
from Hartron
centre,Rishi nagar,
Hisar.
It was a great experience
there.Teachers were also
very friendly.
WORKSPACE
1. In my training I learned alot about C
programming,its uses ,it's importance as a base
language
2. It was a great experience learning C . I also came to
learn about logical building and many more .
3. I also created a project on
Simple calculator in c
It is a simple
calculator using c
language -
I have used switch
statement to do
it.and tried to keep
it simple .
OUTPUT
So, in the output we can see
that
There are 4 options , 1
stand for addition,2 for
subtraction and so on. After
that we will ask the user for
values and it will perform
calculation, that were
supposed to do.
Introduction to C
C is a general-purpose programming
language that's still popular today,
despite being created in 1972. It's a
fundamental language in computer
science and is known for its efficiency,
portability, and flexibility.

C is known for its efficiency, portability,


and flexibility. It allows for low-level
memory manipulation and direct access
to hardware.
Why learn c ?
● It is one of the most popular
programming languages in the
world
● If you know C, you will have no
problem learning other popular
programming languages such as
Java, Python, C++, C#, etc, as the
syntax is similar
● C is very fast, compared to other
programming languages, like Java
and Python
● C is very versatile; it can be used in
both applications and technologies
Simple program in C
Line 1: #include <stdio.h> is a header file
library that lets us work with input and
output functions, such as printf() (used in
line 4). Header files add functionality to C
programs.
Line 2: A blank line. C ignores white
space. But we use it to make the code
more readable
Line 3: Another thing that always appear
in a C program is main(). This is called a
function. Any code inside its curly
brackets {} will be executed.
Line 4: printf() is a function used to
output/print text to the screen. In our
example, it will output "Hello World!".
Variable in C

● int - stores integers (whole


numbers), without decimals,
such as 123 or -123
● float - stores floating point
numbers, with decimals, such
as 19.99 or -19.99
● char - stores single characters,
such as 'a' or 'B'. Characters are
surrounded by single quotes

Story for illustration purposes only


Basic data type
FORMAT SPECIFIER
It is important that you use the
correct format specifier for the
specified data type. If not, the
program may produce errors or even
crash.
Arithmetic Operators
Arithmetic operators are used to perform
common mathematical operations.
Assignment Operators
Assignment operators are used to assign values to
variables.

In the example below, we use the assignment operator


(=) to assign the value 10 to a variable called x:
Comparison Operators
Comparison operators
are used to compare
two values (or
variables). This is
important in
programming, because
it helps us to find
answers and make
decisions.
Loops
Loops can execute a block of code
as long as a specified condition is
reached.

While Loop
The while loop loops through a
block of code as long as a specified
condition is true
Source: theguardian.com
The Do/While Loop
The do/while loop is
a variant of the
while loop. This loop
will execute the
code block once,
before checking if
the condition is
true, then it will
Source: travel.trade.gov
repeat the loop as
Conclusion
In summary, we have
explored C programming .
These insights highlight the
importance of logic building
. Moving forward, it’s
essential to [suggest next
steps or actions]. Thank you
for your attention, and I
look forward to any
questions or discussions.

You might also like