C language contains a number of in-built functions that are used while creating different programms. All the in-built functions has their definitions(prototypes) defined under their respective header files.
Some commonly used in-built Functions
Following are some of the important functions that are used in different programs:
printf() :
This function is defined in
<
stdio.h>
Syntax:
1. printf("Welcome To C");
output : Welcome To C (printing only welcome message)
2. int x = 10;
printf("X is : %d",x);
printing the message and value of x on the screen.
output : X is : 10
scanf() :
This function is defined in <
stdio.h>
function reads input for numbers and other data types from standard input.
<
stdio.h>
<
conio.h>
void main()
{
int x;
clrscr(); // Note the functions must be called after declaring the variables in C
printf("Enter number");
scanf("%d",&x);
printf("%d",x);
getch();
}
<
conio.h>
getch() :
This is defined in <
conio.h>
This is defined in <
conio.h>
delay() :
It is defined in <
dos.h>
Syntax:
delay(unsigned milliseconds);
gotoxy():
It is defined in<
conio.h>
Syntax:
gotoxy(int x,int y);
gets() :
It is defined in <
stdio.h>
There are many other inbuilt functions in c language. We will discuss more others in next topics like string manipulation functions, graphics functions, sound function and many other.
Prev NEXT
0 comments:
Post a Comment