casting in c
#include <stdio.h>
main() {
int sum = 17, count = 5;
double mean;
mean = (double) sum / count;
printf("Value of mean : %f\n", mean );
}
#include <stdio.h>
#include <stdlib.h>
int main(){
int x = 7, y = 5;
float z;
z = (float)x / (float)y; /*Here the value of z is 1.400000*/
return 0;
}(new_type) name_var;
Also in C:
- counter program in c language
- casting in c
- declare variable in c
- matplotlib legend remove box
- error: dereferencing pointer to incomplete type
- change custom post type icon
- read file in C
- arduino vscode upload choosing sketch
- 1 212 32123 4321234 543212345 in c
- print long in c
- even odd c
- typedef vs #define
- change text color c
- how to add a comment in c
- update ubuntu in terminal
- how to create random integers from a specific range in c language
- linux kernel write()
- sum of all column in matrix in c
- root in C
- find the largest number in else if javascript
- markdown empty line
- how to make two arrays equal in c
- why do you jerk while falling aslee
- a c program to computes the prime numbers in the user mentioned range