Examples of valid (but not very descriptive) C variable names:
=> foo
=> Bar
=> BAZ
=> foo_bar
=> _foo42
=> _
=> QuUx
When the accuracy of the floating point number is insufficient, we can use the double to define the number. The double is same as float but with longer precision and takes double space (8 bytes) than float.
To extend the precision further we can use long double which occupies 10 bytes of memory space.
1 : | extern int x; |
2 : | float square ( float x ) { ... } |
3 : | double pow(double, double); |
/* Example for ceil() and floor() functions: */
#include<stdio.h>
#include<math.h>
int main()
{
printf("\n Result : %f" , ceil(1.44) );
printf("\n Result : %f" , ceil(1.66) );
printf("\n Result : %f" , floor(1.44) );
printf("\n Result : %f" , floor(1.66) );
return 0;
}
// Output:
// Result : 2.000000
// Result : 2.000000
// Result : 1.000000
// Result : 1.000000
1. | ! |
2. | sizeof |
3. | ~ |
4. | && |
&& Logical AND is a logical operator.
Therefore, 1, 2, 3 are unary operators.
How Do I Remember ? BODMAS !
1. | Relational |
2. | Arithmetic |
3. | Logical |
4. | Assignment |
Option B: it is syntatically wrong.
Option D: syntatically wrong, it should be return(a>b ? a:b);
Option C: it uses nested conditional operator, this is logic for finding greatest number out of three numbers.
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.