I have to create a program that separates mantissa and exponent from string. I managed to get exponent but not mantissa. | Sololearn: Learn to code for FREE!

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; }

c#

12/21/2017 12:29:47 PM

Walleed Hesham

1 Answer

New Answer

0

this isnt c#