Hello :-)
You have declared the type of value as float
.
However, it is because you entered the value as an element in the character (character) type - char practice[100]
array. The types are inconsistent with each other.
Please note that we have corrected some mistakes in the code you gave us.
#include<stdio.h>
float practice [100]; # Change the type of array from char[100] to float[100].
float value;
int main() { # The main function must return an integer int.
value = 12.6332;
practice[0] = value;
printf("%f\n", practice[0]);
The return 0; # main function must return an integer int.
}
In addition, we will give you a C unlink from Tutorials Point, so it will be helpful if you read the data type part step by step: https://www.tutorialspoint.com/cprogramming/c_arrays.htm
I hope you will help in a matter of experiencing.
Thank you.
© 2024 OneMinuteCode. All rights reserved.