Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary Phython theory and C++theory

Rating
-
Sold
-
Pages
1
Uploaded on
29-05-2023
Written in
2022/2023

The document is mainly based on exam preparation it is very useful to use it

Institution
Course

Content preview

4Character 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.

Variables in C Language
Variables in C are used to store values that the user has entered or values that we have
calculated and stored the results into those variables to display output to the user. While
declaring variables, it is essential to give them names that indicate what value they store.

Variables in C
Variables in C are used to store values for later use in the program. It is important to assign
a value to the variable at the time of declaration to avoid logical errors. Variables should not
contain special characters except for underscore and must start with an alphabet or
underscore. Keywords such as int, float, and char cannot be used as variable names.

Valid variable names: x, roll_number, value_super_cool
Invalid variable names: 0x, if, int
Declaring Variables
To declare a variable in C, we must first write the datatype. Examples of datatypes are int,
float, and char. We can also initialize the variable using the equals operator.

When a variable is declared, the compiler allocates memory to the variable and assigns it an
address location. If the variable is not initialized, it will hold a random value.

Operators in C
C language has a variety of operators, including assignment operators such as =, +=, and
-=. Arithmetic operators such as +, -, *, /, and % are also available.

Escape Sequences
Escape sequences are used in C to print special characters such as double quotes and
slashes. Examples of escape sequences include \n for newline and \t for tab.

Decision Control Structure
Decision control structures in C are used when a program has to make a decision based on
a condition. An if statement is used to execute a set of instructions if the condition is true,
and an else statement is used to execute a set of instructions if the condition is false.

Written for

Institution
Course

Document information

Uploaded on
May 29, 2023
Number of pages
1
Written in
2022/2023
Type
SUMMARY

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
poovara89

Get to know the seller

Seller avatar
poovara89
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
1
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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions