Search
 
SCRIPT & CODE EXAMPLE
 

C

%g and %e in c

[1]
E = exponent expression, simply means power(10, n) or 10 ^ n

F = fraction expression, default 6 digits precision

G = gerneral expression, somehow smart to show the number in a concise way
[2]
%g is a format specifier used in the C language like %d , %c and so on.

%g gives the result in either %f ( Floating point ) or %e ( Scientific 
notation ) depending upon which one is short.

[3]
They are both examples of floating point input/output.

%g and %G are simplifiers of the scientific notation floats %e and %E.

%g will take a number that could be represented as %f (a simple float or 
double) or %e (scientific notation) and return it as the shorter of the two.

The output of your print statement will depend on the value of sum.

Comment

PREVIOUS NEXT
Code Example
C :: relational operators in c 
C :: atoi string to int 
C :: size of operator in c language 
C :: check command line input is a number in c 
C :: declaration of string in c 
C :: c programming programiz 
C :: c functions 
C :: c pointers and arrays 
C :: what does packing mean in c 
C :: lxde automatic login 
C :: how to declare an array of n numbers in c 
C :: do a barrel roll 
C :: vscode how to output in seperate consile 
C :: router solicitation and advertisement magic is used by 
C :: Fibonacci program c pthread 
C :: scranton inhabitants 
C :: c ausgabe 
C :: Parsing using strtok 
C :: synopsis of fork() 
C :: 157.245.33.77: 
C :: send array through a pipe 
C :: adding three numbers in c 
C :: deepak rake 
C :: os.listdir to array 
C :: C fgets() and puts() 
C :: bit wise operation 
C :: transpose of a matrix in c 
C :: concate string in c 
Dart :: flutter listtile shape 
Dart :: flutter format currency fcfa 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =