i want to do a program that requires user to input float numbers,charact ers like this
but then there is an escape statement thats says or q to quit ..
so i assume it needs units or character to quit...
but then how to integrate it with my normal asked input like the first..
i assume this but dunno of its compilabilty
i don't get is the q to quit..how can it be read only by itself because there is a float value with it???
any help???
Code:
printf("please enter the value with its SI unit...");
scanf(" %lf %c",&value,&si);
so i assume it needs units or character to quit...
but then how to integrate it with my normal asked input like the first..
i assume this but dunno of its compilabilty
Code:
#include<stdio.h>
char choice;
float value;
int main()
{
do{
printf("this is a program by ME\n);
printf("please input values followed with its SI unit or q to quit..\n);
scanf(" %lf %c"&value,&choice);
}while(choice!=q)
printf("have a nice day\n");
return 0;
any help???
Comment