سات دن کی نازک معصوم اور بندوق کی پانچ گولیاں۔۔
سات دن کی نازک معصوم اور بندوق کی پانچ گولیاں۔۔
For video lectures please visit and subscribe the channel
https://youtu.be/dq6vEoGCkoI
Whatsup group
https://chat.whatsapp.com/LbV9FNen1eT5C2VDhThFOe
getch()
The
word getch stands for get character, The getch function is used to input a single
character from the user. When the functions are executed, it waits for any key to
be pressed. The character entered by the user is not displayed on the screen
The
function getch() is defined in the header file conio.h therefore the header
file must be included in the program to sue this function.
Syntax:
Method-1:
getch();
This
is normally used in a program to stop the execution of the program temporarily.
Method-2:
variable=
getch();
It takes any character from the keyboard and stores that character
in the variable
getche():
The
word getche() stands for get character. The letter e in getche stands
for echo. the () function is used to input a single character from the user. When this function
is executed, it waits for any key to be pressed. The function echos (display)
the character on the screen entered by the user.
Syntax:
variable=
getche();
__________________________________________________________________________
gets
() function:
The gets function is used to input string
values from the user. The input is stored in a string variable. The user can
enter any type of letter including alphabets, digits, special symbols, and
spaces. After typing the string from the keyboard, the user presses ENTER key and
the string is stored in the variable. The null characters \0 are automatically
entered at the end of the string.
Syntax:
gets(variable);
Notes of Chapter-2 Class 10 Computer Science
Notes of User Interaction of class 10 Punjab Curriculum and Textbook Board, Lahore
This note contains all theory, unsolved Activities, exercise Questions, and coding
Click the below link to download
https://drive.google.com/file/d/1amZzyIK-12CeLoFD5pb8ce5jmfWFPYE5/view?usp=sharing
SCANF():
The scanf function is used to get input from the user. The input
is stored in a variable in a specified format.
Syntax:
The syntax of scanf function is as follows
scanf (format string, &variable1, &variable2, &variable3);
Format String:
The format string is given in double quotes It may consist of different format
Specifiers that indicate the format according to which values will be entered.
Variables: The
variables are used to store the value entered by the user through the keyboard.
Each variable refers to a memory location. The symbol & indicates the memory
location of the variable in which the input is stored It is called the address operator
Getting Single Input.
Examples:
Getting single input:
scanf (“%d”, &a);
The above statement is used to get integers input. The value
entered by the user will be stored in variable “a”.
Getting Multiple input:
Scanf function can be used to input many values at the same
time as follows;
scanf(“%d %d ,&a, &b);
The above statement will get two inputs in a and b respectively.
It is also possible to get different types of input in the same function as
follows
scanf (“%d %f”, &a, &b);
The scanf function is normally used in combination with printf
function. The purpose of using printf function before scanf is to tell the user
that the computer is waiting for input.
Example:
printf(“ Enter your marks”);
scanf(“%d” ,&a);
Define: The printf() function is used to display output on the screen. It is defined in stdio.h (header file) in C library.
syntax: printf( "format string", argument list);
Explanation: Format string is also known as control string. It may consist of the following
Text: Any message to display on the screen.
E.g: printf( " This is the message");
Format specifier: Specify how the values of variables will be displayed.
Escape sequence: Specify the format of the output. It always starts with backslash "\".
انٹرمیڈیٹ_کے_طلباء_و_طالبات_متوجہ_ہوں۔... یہ پوسٹ آپ کے مستقبل سے متعلق ہے۔ عام طور پر میڈیکل کے طلبہ سمجھتے ہیں کہ میڈیکل میں ایم بی بی ایس...