Mega Code Archive

 
Categories / C Tutorial / Data Type
 

Define float in In scientific notation (The E notation)

#include <stdio.h>   int main() {     float lightyear=5.878E12;     float jupiter=483400000;     float distance;       distance=jupiter/lightyear;       printf("Jupiter is %f light years from the sun.\n",distance);       return(0); } Jupiter is 0.000082 light years from the sun.