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
Class notes

Important c programming Questions and answers- data types,loops, operators and programs

Rating
-
Sold
-
Pages
25
Uploaded on
10-11-2025
Written in
2025/2026

This document contains important and frequently asked questions with detailed answers from C Programming, ideal for B.Tech, Diploma, and intermediate students. It covers Unit-wise explanations, syntax, programs, and outputs for all major topics including: Data types and variables Algorithms and flowcharts Operators (relational, logical, bitwise) Control statements (if-else, switch, loops) Functions and structure of C program Sample programs (factorial, palindrome, prime number, calculator, etc.) Perfect for exam preparation, assignments, and quick revision — written in a clear, easy-to-understand format

Show more Read less
Institution
Course

Content preview

1.Explain Primitive Data Types in C with Suitable
Examples ?




Integer Data Type

The integer datatype in C is used to store the integer numbers(any number including positive, negative and
zero without decimal part). Octal values, hexadecimal values, and decimal values can be stored in int data type
in C.

Range: -2,147,483,648 to 2,147,483,647(the max & minimum values that can be stored in a variable of a
datatype)

Size: 4 bytes

Format Specifier: %d

The integer data type can also be used as

1. unsigned int: Unsigned int data type in C is used to store the data values from zero to positive
numbers but it can’t store negative values like signed int.

2. short int: It is lesser in size than the int by 2 bytes so can only store values from -32,768 to 32,767.

3. long int: Larger version of the int datatype so can store values greater than int.

4. unsigned short int: Similar in relationship with short int as unsigned int with int.

Character Data Type

Character data type allows its variable to store only a single character. The size of the character is 1 byte. It is
the most basic data type in C.

Range: (-128 to 127) or (0 to 255)

Size: 1 byte

Format Specifier: %c

Float Data Type

,In C programming float data type is used to store floating-point values. Float in C is used to store decimal and
exponential values. It is used to store decimal numbers (numbers with floating point values) with single
precision.

Range: 1.2E-38 to 3.4E+38

Size: 4 bytes

Format Specifier: %f




2.What is an Algorithm? Explain the characteristics of
algorithm with example?
An algorithm is a step-by-step process, or a set of rules designed to perform a specific task or solve a
particular problem. Algorithms serve as a blueprint for writing code, guiding the program through a
sequence of operations to achieve a desired outcome.

Characteristics of an Algorithm:

Input: The algorithm takes zero or more inputs.
Output: The algorithm produces one or more outputs.
Definiteness: Each step of the algorithm is clear and unambiguous.
Finiteness: The algorithm must terminate after a finite number of steps.
Effectiveness: Each step of the algorithm is basic enough to be performed, ideally by a computer

Examples:
Algorithm-1: Addition of Two Numbers

1. Start
2. Input: Read two numbers, num1 and num2.

, 3. Process: Calculate the sum of the two numbers by performing the operation: sum =
num1 + num2
4. Output: Display or return the result, sum.
5. End


3) Explain Relational and logical Operators with Suitable
Examples ?
Relational Operators:Relational operators are used to compare two values. The result of the comparison is
either true or false.

The following table give the list of relational operators :
Operator Meaning
> Greater than
< Less than
== Equal to
!= not equal to
<= less than or equal to
>= greater than or equal to
Let a=9, b=5 then the operations with relational operators are listed below.
Expression Result
a>b 1
a<b 0
a==b 0
a!=b 1
a<=b 0
a>=b 1




output:

Written for

Institution
Course

Document information

Uploaded on
November 10, 2025
Number of pages
25
Written in
2025/2026
Type
Class notes
Professor(s)
Lava raju
Contains
All classes

Subjects

$22.39
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
singamsettisanjanakavya

Also available in package deal

Get to know the seller

Seller avatar
singamsettisanjanakavya Aditya university
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
5 months
Number of followers
0
Documents
2
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