0
I have to create a program that separates mantissa and exponent from string. I managed to get exponent but not mantissa.
#include <stdlib.h> #include<stdio.h> #define SIZE 20 typedef struct{ double m; /* The mantissa component */ int expo; /* The exponent component */ } sci_not_t; /* Variable name*/ int main (void) { sci_not_t num; char input [SIZE]; printf("Please enter the number: "); scanf("%[^e]e%d", input, &num.expo); sscanf(input,"%1f",&num.m); printf("Exponent is: %d\nMantissa is:%e\n",num.expo,num.m); return 0; }
1 Resposta
0
this isnt c#