100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
C Programming Basics $5.49   Add to cart

Class notes

C Programming Basics

 6 views  0 purchase
  • Course
  • Institution

Basics for C language.

Last document update: 1 year ago

Preview 1 out of 2  pages

  • September 15, 2023
  • September 15, 2023
  • 2
  • 2022/2023
  • Class notes
  • None
  • C programming basics
avatar-seller
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.

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller ishrathayesha. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $5.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

77529 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$5.49
  • (0)
  Add to cart