Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Functions of stdio conio
1. G. H. Patel College of
Engineering & Technology
Subject: Computer Programming and
Utilization(2110003)
Branch: Information Technology
Batch: 1D16
Academic Year: 2016-2017(Even)
Topic: Functions of stdio.h and conio.h
2. Topic : Functions of stdio.h and conio.h
Group Members:-
Khyati Valera (160110116059)
Rutvi Vasani (160110116060)
Bhavik Vashi (160110116061)
Shivam Zala (160110116062)
3. Functions of stdio.h
1.printf()
-This function is used to print the character
,string,float,integer , octal and hexadecimal values
onto the output screen.
-The general format of printf is as follows:
printf(“statement”);
4. 2.scanf()
-This function is used to read a character string ,
numeric data from the user.
-Another way of giving values to variable to input
through keyboard using the scan function.
5. - The general format scanf is as follows
scanf(“control string”, &variable1,&variable2,...)
-The ampersand symbol & before each variable is an
operator that specifies the variable name’s address.
-Example
scanf(“%d”,&n);
6.
7. In the above C program ,
- in 6th line execution it prints
Give me a
-than after we used scanf() function in that statement
syntax is that
scanf(“%d”,&a);
it means computer take a data from the user and which is
stored at a. here used %d means data type is integer.
8. -Also printf and scanf done in line 11 & 12
-Then in line 16 output is
addind value of a and value of b is a+b
-Here the type of output is also interger because we use % d
in printf statement.
-Here in printf statement at last n is used for after this
execution go to the new line in output.
-%d for integer values
%f for float values
%c for character
9. 3. getchar()
- It reads character from keyboard.
- Reading a single character can be using the
function getchar.
- The getchar takes following as:
variable_name=getchar();
- variable_name must be declared in char type.
10. 4. putchar()
-It writes the character to the screen.
-Like getchar, there is an analogous function
putchar for writing characters
at a time to the terminal.
-It takes the form as :
putchar (variable_name);
11.
12. 5. gets()
- It read the line – string from the user.
- To read the string in C program we use gets() function.
- Thus, an entire line of the text can be read and stored
in array the reading is terminated when the null
character is inserted at the end of string.
- The simply gets function write as
char string_name[string_length];
gets (string_name);
13. 6. puts()
- It write the string (line) from the user.
- Another more convenient way to printing string
value is using puts function.
- Format of puts function is follow as
puts(string_name);
14.
15. -Here in above C program there is one string a str
-The string having a length of 35 because decalration
of string is as follows
char name[size of string];
-gets(str);
When this line executed computer takes string (
line ) from the user through keyboard.
-Then we are printing the string it shows as in
program puts(str);
16. Functions of conio.h
Conio.h header file used in C programming language for console
input and output.
Some of the most commonly used functions of conio.h are
1. clrscr()
2.getch()
17. kbhit - Determines if a keyboard key was pressed.
gcgets - Reads a string directly from the console.
cscanf - Reads formatted values directly from the console.
putch - Writes a character directly to the console.
cputs - Writes a string directly to the console.
cprintf - Formats values and writes them directly to the console.
clrscr - Clears the screen.
getch - Get char entry from the console
18. 1.clrscr()
- It is used to clear screen.
- It is writing in C program as follows:
clrscr();
19. 2. getch()
-It is used to get character from output screen to come
into the exit screen.
-Normally this function is written in the last of body.
-It is written in C program as
getch();