Standard Input Output Hearder File
Standard Input Output Hearder File
2019
Edit program
2:- Run time error/ logical error
compile
Run
O/P
Exit
Header Files : Header file are predefined library files , contain predefined functions and
categorized related to their functionality
Syntax : #include<headerfile.h>
Example
#include< stdio.h > : contain functions related to input / output operation
#include< math.h > : contain functions related to math operation
#include< conio.h > : contain functions related to console device operation
#include< string.h > : contain functions related to string operation
#include< dos.h > : contain functions related to DOS operation
printf( ):- It is a formatted function of < stdio.h > header file which is used to print some
message or valves on moniter..
formatted specifiers /characters in “C”
Ex: 1 ) - printf ( “Hello India ” ); Datatype Specifiers
O/P :- Hello India int %d, %i
char %c
Ex 2 ) - int X=5; float %f
char Y=’A’; string %s
float Ch=10.5; unsigned int %u
long int %ld
double %lf
FACULTY : SANDEEP SAHU( M.Tech(CSE))Page 1 long double %Lf
AIM POINT INFOSYSTEM PVT. LTD. 2019
z= x/y ;
Type casting :- By this the compiler reads one primitive datatype as another primitive
Datatype( Temporary only )
Note : We cant change data type in any computer language ( there is no concept )
Exercise : int x ,y ;
float z ;
z = ( float ) x / y ;
z = x / ( float ) y ;
z = float ( x ) / y ;
z = ( float ) ( x / y ) ;
Note :-
Assignments :
1 ) WAP to calculate average of three nos .
2 ) WAP to convert temperature Fahrenheit to centigrade .
3 ) WAP to calculate area of triangle , rectangle and circle .
clrscr();
printf("\nEnter values a , b and c :");
scanf("%d%d%d",&a,&b,&c);
printf("\n Root1= %f “ , );
printf("\n Root1= %f “ , );
}
ASCII value ( )
Definition : -
Note :- In case of int compiler directly convert int into binary no and stored in 2 bytes ,
where in case of char compiler convert the ASCII value of char in binary no and stored
in 1 byte .
//WAP to convert any upper case character into lower case character:-
#include<stdio.h>
void main()
{ char ch;
printf("enter any character");
scanf("%c",&ch);
#include<stdio.h>
void main()
{ char ch;
int x;
printf("\n Enter any digit character : ");
scanf("%c",&ch);