First Module Unvsty Questions
First Module Unvsty Questions
PART A
Part B
1. Explain significant of C
2. Assignment operator in detail
3. Design a flow chart to find average of 2 numbers
4. Bitwise operator in detail
5. Explain methods to add comments in c program
6. Formatted input and output in detail
7. Structure of c program with example
8. Arithmetic operator with examples
Part c
1. Tokens in C with example
2. Algorithm n flowchart to find the biggest of 10 number given as input
3. Process involved in Design n development of a program
4. C tokens in detail
C Comments
The comments in C are human-readable explanations or notes in the source code of a C program. A
comment makes the program easier to read and understand. These are the statements that are not
executed by the compiler or an interpreter.
1. A person reading a large code will be bemused if comments are not provided about details
of the program.
2. C Comments are a way to make a code more readable by providing more descriptions.
4. C Comments can be used to prevent the execution of some parts of the code.
Types of comments in C
Single-line comment
Multi-line comment
Types of Comments in C
1. Single-line Comment in C
A single-line comment in C starts with ( // ) double forward slash. It extends till the end of the line
and we don’t need to specify its end.
Multi-line Comments in C
In C programming, there is another type of comment that allows us to comment on multiple lines at
once, they are multi-line comments.
For example,
#include <stdio.h>
int main() {
return 0;
We use the formatted input and output functions in the C language for taking single or multiple
inputs from the programmer/user at the console. These functions also allow a programmer to
display single or multiple values, in the form of output, to the users present in the console.
printf() We use this function for displaying a single or multiple values in the form of output for the user
end at the console.
scanf() We use this function for reading a single or multiple values in the form of input from the user
end at the console.
sprintf() We use this function for reading the values that are stored in various variables, and for storing
these values into the array of characters.
sscanf() We use this function for reading the characters available in the string, and then storing them into
the available variables.
Example of printf()
The character that we specify after the ‘%’ character refers to the conversion character. It is because
‘%’ allows the conversion of any given data type into another data type for further printing.
d The program performs the conversion of the data into integers (decimals).
f The program generates data output in the form of a double or a float with the default of a
Precision 6.
s The program identifies the data as a string, and a single character from this string gets
printed unless and until the program reaches a NULL character.
/n Used by a program for a new line (it is also known as a linefeed return)
* file: age.c
* author: you
*/
getch();