0
What is the solution of displayed error. Please reply
10 Answers
+ 1
You have not even declared your variable "f" then how can you even use it. The integer variable "c" takes the user input but then you are trying to assign a float value to it.
Do you understand? Atleast tell us what conversion do you want so that we can help you.
+ 1
If you take int value from user and you convert it into float then you will just get the same number followed by 0's.
Eg- int a = 10;
float b = a;
// output 10.000000
+ 1
If that is what you want then do this
int c;
printf("enter no");
scanf("%d",&c);
float f = c;
printf("\nvalue is %f",f);
0
What are you actually trying to do?
I'm asking this because you are really confused and are not clear about the data types you are using and assigning.
0
What is meant by
"Expected expression before'float' "??
0
I want int value from user but want to display it in float value.
Hence I was using data type conversion but it seems that syntax is somewhat wrong
0
Thank you first for answering to my little question
0
Yeah I know that
0
Thanks
0
Oh I got it. Doubt cleared