100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Class notes

C Programming Basics

Rating
-
Sold
-
Pages
2
Uploaded on
15-09-2023
Written in
2022/2023

Basics for C language.

Institution
Course








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Course

Document information

Uploaded on
September 15, 2023
File latest updated on
September 15, 2023
Number of pages
2
Written in
2022/2023
Type
Class notes
Professor(s)
None
Contains
C programming basics

Subjects

Content preview

Introduction to C Language


C is a high-level language that was founded in 1972 at AT&T Bell Labs by Mr. Dennis
Ritchie. It is popular due to its large feature list and speed. Many operating systems,
embedded programs used for microprocessors and games are built using C language.
Even today, many consider C language to be their first language to learn coding
because of its simplicity.
When we write a C program, the program is compiled by a compiler to convert it into
machine language code, which is the code that computers can understand. Writing C
programs is easier than writing directly in machine-level language, which is usually ones
and zeros. Instead, we can write C programs, which are closer to English and then use
a compiler to convert it into machine-level language.
Core Block of a C Program
Every C program has a hash include in the angular bracket header files. All header files
contain predefined functions, which we can directly use. We can include one or more
header files. All C programs start with a fixed function name called 'main'. Every
function in C returns a value, and in this case, we are returning a value as int.
The starting curly braces and ending curly braces indicate the point from where our
main function starts and where it ends. All the lines between these parentheses are our
block of main function. Inside of our main code block, we can have declaration
statements, decision control statements, loops, call to other functions, special keywords,
and our written value.
Execution of a C Program
During the time of compilation, the compiler combines our code line by line, and when it
gets converted into machine code, that machine code is also executed line by line.
Hence, it is necessary to understand how exactly we can instruct the computer in a
stepwise manner so that we can achieve our desired output.
Format Specifiers and Basic Functions
We are going to talk about format specifiers and basic functions that are required in
order to take input from the user or to display output to the user. The commonly used
functions are printf and scanf, and we will be requiring these functions quite often.
Character Sets and Constants in C Language
The character set in C has all alphabets, digits, facial symbols, and additional ASCII
characters. Constants in C language are of two types - primary constants and
secondary constants. Primary constants in C are integer, real, and character.
Basic Data Types in C
The three basic data types in C are int, float, and char. Int is used to store whole
numbers, while float is used to store real values or values that contain decimal points.
Char is used to store characters.
$5.49
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
ishrathayesha

Get to know the seller

Seller avatar
ishrathayesha KCG College of Technology
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
2 year
Number of followers
0
Documents
0
Last sold
-

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

Frequently asked questions