DO NOT MISS

Ads

Wednesday 29 June 2016

Output Functions in C-Programming



The C language provides a set of library functions to perform input and output (I/O) operations. Those functions can read or write any type of data to files.



Here printf(),scanf() functions are included in #include<stdio.h> 
Printf() ---->  to print the Information. 
Scanf()  ----> to read the Values. 



Here clrscr(), getch() functions are included in #include<conio.h> 

Clrscr(); ----> to clear the previous output’s 

Getch(); ----> to get the information or values



Computer displaying result is called output.

If we want to display the information on standard Output device we can use printf().



Printf( ):- 

It is standard Output function which is used to display the information given by the user.


Syntax: 
They are 3 types of syntax's.




Syntax 1: 
printf(" information");
To print information. 

Ex:- 

printf("Computersadda");

Sample Program:-

#include<stdio.h>

#include<conio.h>

void main() 

     {

     clrscr();

           printf("welcome to C-language");

      getch();

    }

Output:-


welcome to C-language

Sample Program 2:-

#include<stdio.h>

#include<conio.h>

void main( )

     {

     clrscr( );

           printf("One");

           printf("Two");

           printf("Three");

      getch( );

      }

Output:-

OneTwoThree


Syntax 2 :

printf(" control string ",variable name);
To print 1 value.

Ex:- 
printf("%d", a);
Syntax 3: 

printf(" control strings ",variablename1,--- variablename n);
To print more than 1 value.

Ex:- 
printf("%d%d",a,b);

__________________________________________________________________________________

__________________________________________________________________________________

Greataims

 
Copyright © 2016 Computersadda. Designed by @ Computersadda Team - Published By Greataims