Page 20 - PROGRAMMING IN C_Neat
P. 20
Example:
3
double x = pow(2, 3); x = 2 Output:
x = 8
9. sqrt():
Used to find the square root value of its argument.
General Form:
double sqrt(double a);
Example:
double x = sqrt(36); Output:
x = 6
_______________________________________________________________________________________
12. Explain the input/output functions present in <stdio.h> header file. OR Explain the standard
input/output functions. *
Standard Input/Output Functions:
Standard input/output functions are stored in the stdio.h header file.
1. scanf():
Used to get data as input from the keyboard.
Example:
int a;
scanf(“%d”, &a);
2. printf():
Used to display data as output on the monitor.
Example:
int x = 2000; Output:
printf(“%d”, x);
2 0 0 0
3. getchar():
Used to read a character from the keyboard.
Example:
char a;
a = getchar();
4. putchar():
Used to display a character on the monitor.
Example:
putchar(‘K’);
5. gets():
Used to read a string from the keyboard.
Example:
char a[10];
gets(a);
6. puts():
Used to display a string on the monitor.
Example:
puts(“Kandan”);