Proper indentation and readability (#23082)
Included one of the C code snippets inside ```c``` to improve readability
This commit is contained in:
committed by
Manish Giri
parent
bd64a9619a
commit
603df3975e
@ -119,7 +119,7 @@ double angle = cos(90.00); // Givs us 0.00
|
|||||||
int result = sqrt(16); // Gives us 4
|
int result = sqrt(16); // Gives us 4
|
||||||
double result = log(10.00) // Gives us 2.30 (note this is ln(10), not log base 10)
|
double result = log(10.00) // Gives us 2.30 (note this is ln(10), not log base 10)
|
||||||
```
|
```
|
||||||
|
```c
|
||||||
// C code to illustrate
|
// C code to illustrate
|
||||||
// the use of ceil function.
|
// the use of ceil function.
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -127,21 +127,21 @@ double result = log(10.00) // Gives us 2.30 (note this is ln(10), not log base 1
|
|||||||
|
|
||||||
int main ()
|
int main ()
|
||||||
{
|
{
|
||||||
float val1, val2, val3, val4;
|
float val1, val2, val3, val4;
|
||||||
|
|
||||||
val1 = 1.6;
|
val1 = 1.6;
|
||||||
val2 = 1.2;
|
val2 = 1.2;
|
||||||
val3 = -2.8;
|
val3 = -2.8;
|
||||||
val4 = -2.3;
|
val4 = -2.3;
|
||||||
|
|
||||||
printf ("value1 = %.1lf\n", ceil(val1));
|
printf ("value1 = %.1lf\n", ceil(val1));
|
||||||
printf ("value2 = %.1lf\n", ceil(val2));
|
printf ("value2 = %.1lf\n", ceil(val2));
|
||||||
printf ("value3 = %.1lf\n", ceil(val3));
|
printf ("value3 = %.1lf\n", ceil(val3));
|
||||||
printf ("value4 = %.1lf\n", ceil(val4));
|
printf ("value4 = %.1lf\n", ceil(val4));
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
```
|
||||||
# Before you go on...
|
# Before you go on...
|
||||||
## A review
|
## A review
|
||||||
* There are several basic operators:
|
* There are several basic operators:
|
||||||
|
Reference in New Issue
Block a user