0% found this document useful (0 votes)
10 views5 pages

ITPS Viva QNS CU INFORMATION

The document defines key concepts in C programming such as data types, variables, constants, functions, loops, operators, and input/output functions. It explains that C is a general-purpose language used to write system software and the "main" function acts as the entry point. Common data types include int, float, char, and void, while arrays allow storing multiple values of the same type. Functions perform tasks and can return values, while loops iterate code and break/continue control flow.

Uploaded by

siyalohia8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views5 pages

ITPS Viva QNS CU INFORMATION

The document defines key concepts in C programming such as data types, variables, constants, functions, loops, operators, and input/output functions. It explains that C is a general-purpose language used to write system software and the "main" function acts as the entry point. Common data types include int, float, char, and void, while arrays allow storing multiple values of the same type. Functions perform tasks and can return values, while loops iterate code and break/continue control flow.

Uploaded by

siyalohia8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

What is C programming language?

C is a general-purpose programming language that was


developed to write system software.

What is a variable?
A variable is a named memory location that can hold a value
of a particular data type.

What is a constant?
A constant is a value that does not change during the
execution of a program.

What is the purpose of the "main" function?


The "main" function is the entry point of a C program, where
the program execution begins.

What is the difference between "printf" and "scanf"?


"printf" is used to display output on the console, while
"scanf" is used to read input from the console.

What are the basic data types in C?


The basic data types in C are int, float, double, char, and
void.

What is an array?
An array is a collection of elements of the same data type,
stored in contiguous memory locations.
What is a function?
A function is a block of code that performs a specific task
and can be called from anywhere in the program.

What is the purpose of the "return" statement?


The "return" statement is used to terminate a function and
optionally return a value to the calling function.

What is the difference between "break" and "continue"?


"break" is used to exit from a loop or switch statement, while
"continue" is used to skip the current iteration of a loop.

What are the types of loops in C?


The types of loops in C are "for," "while," and "do-while."

What is the "sizeof" operator used for?


The "sizeof" operator is used to determine the size of a
variable or data type.

What is the ternary operator?


The ternary operator is a shorthand form of an "if-else"
statement.

What is the "void" data type used for?


The "void" data type is used to indicate the absence of a
value.

What is the purpose of the "continue" statement in a


loop?
The "continue" statement is used to skip the current
iteration of a loop.

What is the size of "char" data type?


The size of the "char" data type is 1 byte.

What is the size of "int" data type?


The size of the "int" data type depends on the platform and
compiler, but it is usually 2 or 4 bytes.

What is the difference between a local variable and a


global variable in C?
A local variable is declared within a function and has limited
scope, accessible only within that function. A global variable
is declared outside any function and can be accessed
throughout the program.

1. Explain the difference between 'int' and 'float' data types.


'int' is for integers, while 'float' is for floating-point (decimal)
numbers.
2. What are variables in C?
Variables are named memory locations used to store data during
program execution.

3. How do you declare a variable in C?


Use the syntax: data_type variable_name;

4. What is the 'if' statement in C?


The 'if' statement is used for conditional execution, where code
runs if a given condition is true.

5. What is a 'switch' statement? -


'switch' is used for multi-way decision-making based on the value
of an expression.
6. What is the purpose of the 'break' statement in a 'switch'
case? -
'break' is used to exit the 'switch' statement and prevent further
case evaluation.
7. How do you take user input in C? -
Use scanf function: scanf("%data_type", &variable);
8. Explain the 'while' loop in C. -
The 'while' loop repeatedly executes a block of code as long as a
given condition is true.
9. What is a pointer in C? -
A pointer is a variable that stores the memory address of another
variable.
10. What is the 'const' keyword used for in C? -
'const' is used to declare constants that cannot be changed after
initialization.
11. What is the 'printf' function used for? -
printf is used to display output on the console.
12. What is the 'scanf' function used for? -
scanf is used for taking user input.
13. What are bitwise operators in C? -
Bitwise operators perform operations at the bit level, like AND,
OR, and XOR.
14. What is the 'goto' statement used for? -
'goto' allows you to transfer control to a labeled statement in your
program.

You might also like