Dividing negative number in C [duplicate]










0
















This question already has an answer here:



  • C program to convert Fahrenheit to Celsius always prints zero

    8 answers



Hi, i am absolute newbie in programming. I am starting with learning C by book "C Programming Language (2nd Edition)" and stuck in very first example where we get exercise to write simple program that prints values of temperatures from lower to upper in 2 columns (tabs) that contains Celsius a Fahrenheit.



I'v get problem because trying to edit those code for:



  1. Celsius is main system.

  2. Steps measured dynamically by dividing lower on any given number.

And all work perfectly while i am using integers variables.



#include <stdio.h>

main()

int celcius, farenheit;
int lower, upper, step;

lower = -273.15;
upper = 0;
step = lower / -10; // Dividing lower temperature by given number

celcius = lower;

while (celcius <= upper)
farenheit = celcius * 9/5 + 32;
printf("%dt%dn", celcius, farenheit);
celcius = celcius + step;




But goes to absolutely random numbers when i try using float or double variables for more precise result: (There is code and output in terminal)



#include <stdio.h>

main()

float celcius, farenheit;
float lower, upper, step;

lower = -273.15;
upper = 0;
step = lower / -10; // Dividing lower temperature by given number

celcius = lower;

while (celcius <= upper)
farenheit = celcius * 9/5 + 32;
printf("%dt%dn", celcius, farenheit);
celcius = celcius + step;




Output:



1610612736 1073741824
1073741824 1073741824
-1073741824 1073741824
1073741824 536870912
-1073741824 536870912
1073741824 0
-2147483648 0
-2147483648 -2147483648
536870912 -1610612736
-2147483648 0


So what happened behind that number magic and how to get this to work?










share|improve this question















marked as duplicate by Lundin c
Users with the  c badge can single-handedly close c questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 12 '18 at 7:44


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • 1





    You should post the code that causes the erroneous output (it seems from your text as if the output is not from the code you posted)

    – M.M
    Nov 12 '18 at 3:00











  • regarding: main() there are only two valid signatures for main they are int main( void ) and int main( int argc, char * argv )

    – user3629249
    Nov 12 '18 at 3:04











  • regarding: lower = -273.15; upper = 0; step = lower / -10; this is dividing a negative number by a negative number. The result will be positive

    – user3629249
    Nov 12 '18 at 3:06











  • please do not be editing the code in response to comments. Rather, add a 'EDIT' section that contains any edited code

    – user3629249
    Nov 12 '18 at 3:08






  • 1





    regarding: printf("%dt%dn", celcius, farenheit); the variables celcius and farenheit are float values. so the format string should be using %f, not %d

    – user3629249
    Nov 12 '18 at 3:12















0
















This question already has an answer here:



  • C program to convert Fahrenheit to Celsius always prints zero

    8 answers



Hi, i am absolute newbie in programming. I am starting with learning C by book "C Programming Language (2nd Edition)" and stuck in very first example where we get exercise to write simple program that prints values of temperatures from lower to upper in 2 columns (tabs) that contains Celsius a Fahrenheit.



I'v get problem because trying to edit those code for:



  1. Celsius is main system.

  2. Steps measured dynamically by dividing lower on any given number.

And all work perfectly while i am using integers variables.



#include <stdio.h>

main()

int celcius, farenheit;
int lower, upper, step;

lower = -273.15;
upper = 0;
step = lower / -10; // Dividing lower temperature by given number

celcius = lower;

while (celcius <= upper)
farenheit = celcius * 9/5 + 32;
printf("%dt%dn", celcius, farenheit);
celcius = celcius + step;




But goes to absolutely random numbers when i try using float or double variables for more precise result: (There is code and output in terminal)



#include <stdio.h>

main()

float celcius, farenheit;
float lower, upper, step;

lower = -273.15;
upper = 0;
step = lower / -10; // Dividing lower temperature by given number

celcius = lower;

while (celcius <= upper)
farenheit = celcius * 9/5 + 32;
printf("%dt%dn", celcius, farenheit);
celcius = celcius + step;




Output:



1610612736 1073741824
1073741824 1073741824
-1073741824 1073741824
1073741824 536870912
-1073741824 536870912
1073741824 0
-2147483648 0
-2147483648 -2147483648
536870912 -1610612736
-2147483648 0


So what happened behind that number magic and how to get this to work?










share|improve this question















marked as duplicate by Lundin c
Users with the  c badge can single-handedly close c questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 12 '18 at 7:44


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • 1





    You should post the code that causes the erroneous output (it seems from your text as if the output is not from the code you posted)

    – M.M
    Nov 12 '18 at 3:00











  • regarding: main() there are only two valid signatures for main they are int main( void ) and int main( int argc, char * argv )

    – user3629249
    Nov 12 '18 at 3:04











  • regarding: lower = -273.15; upper = 0; step = lower / -10; this is dividing a negative number by a negative number. The result will be positive

    – user3629249
    Nov 12 '18 at 3:06











  • please do not be editing the code in response to comments. Rather, add a 'EDIT' section that contains any edited code

    – user3629249
    Nov 12 '18 at 3:08






  • 1





    regarding: printf("%dt%dn", celcius, farenheit); the variables celcius and farenheit are float values. so the format string should be using %f, not %d

    – user3629249
    Nov 12 '18 at 3:12













0












0








0









This question already has an answer here:



  • C program to convert Fahrenheit to Celsius always prints zero

    8 answers



Hi, i am absolute newbie in programming. I am starting with learning C by book "C Programming Language (2nd Edition)" and stuck in very first example where we get exercise to write simple program that prints values of temperatures from lower to upper in 2 columns (tabs) that contains Celsius a Fahrenheit.



I'v get problem because trying to edit those code for:



  1. Celsius is main system.

  2. Steps measured dynamically by dividing lower on any given number.

And all work perfectly while i am using integers variables.



#include <stdio.h>

main()

int celcius, farenheit;
int lower, upper, step;

lower = -273.15;
upper = 0;
step = lower / -10; // Dividing lower temperature by given number

celcius = lower;

while (celcius <= upper)
farenheit = celcius * 9/5 + 32;
printf("%dt%dn", celcius, farenheit);
celcius = celcius + step;




But goes to absolutely random numbers when i try using float or double variables for more precise result: (There is code and output in terminal)



#include <stdio.h>

main()

float celcius, farenheit;
float lower, upper, step;

lower = -273.15;
upper = 0;
step = lower / -10; // Dividing lower temperature by given number

celcius = lower;

while (celcius <= upper)
farenheit = celcius * 9/5 + 32;
printf("%dt%dn", celcius, farenheit);
celcius = celcius + step;




Output:



1610612736 1073741824
1073741824 1073741824
-1073741824 1073741824
1073741824 536870912
-1073741824 536870912
1073741824 0
-2147483648 0
-2147483648 -2147483648
536870912 -1610612736
-2147483648 0


So what happened behind that number magic and how to get this to work?










share|improve this question

















This question already has an answer here:



  • C program to convert Fahrenheit to Celsius always prints zero

    8 answers



Hi, i am absolute newbie in programming. I am starting with learning C by book "C Programming Language (2nd Edition)" and stuck in very first example where we get exercise to write simple program that prints values of temperatures from lower to upper in 2 columns (tabs) that contains Celsius a Fahrenheit.



I'v get problem because trying to edit those code for:



  1. Celsius is main system.

  2. Steps measured dynamically by dividing lower on any given number.

And all work perfectly while i am using integers variables.



#include <stdio.h>

main()

int celcius, farenheit;
int lower, upper, step;

lower = -273.15;
upper = 0;
step = lower / -10; // Dividing lower temperature by given number

celcius = lower;

while (celcius <= upper)
farenheit = celcius * 9/5 + 32;
printf("%dt%dn", celcius, farenheit);
celcius = celcius + step;




But goes to absolutely random numbers when i try using float or double variables for more precise result: (There is code and output in terminal)



#include <stdio.h>

main()

float celcius, farenheit;
float lower, upper, step;

lower = -273.15;
upper = 0;
step = lower / -10; // Dividing lower temperature by given number

celcius = lower;

while (celcius <= upper)
farenheit = celcius * 9/5 + 32;
printf("%dt%dn", celcius, farenheit);
celcius = celcius + step;




Output:



1610612736 1073741824
1073741824 1073741824
-1073741824 1073741824
1073741824 536870912
-1073741824 536870912
1073741824 0
-2147483648 0
-2147483648 -2147483648
536870912 -1610612736
-2147483648 0


So what happened behind that number magic and how to get this to work?





This question already has an answer here:



  • C program to convert Fahrenheit to Celsius always prints zero

    8 answers







c integer output floating negative-number






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 '18 at 3:03







Ablix Corner

















asked Nov 12 '18 at 2:58









Ablix CornerAblix Corner

32




32




marked as duplicate by Lundin c
Users with the  c badge can single-handedly close c questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 12 '18 at 7:44


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Lundin c
Users with the  c badge can single-handedly close c questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 12 '18 at 7:44


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









  • 1





    You should post the code that causes the erroneous output (it seems from your text as if the output is not from the code you posted)

    – M.M
    Nov 12 '18 at 3:00











  • regarding: main() there are only two valid signatures for main they are int main( void ) and int main( int argc, char * argv )

    – user3629249
    Nov 12 '18 at 3:04











  • regarding: lower = -273.15; upper = 0; step = lower / -10; this is dividing a negative number by a negative number. The result will be positive

    – user3629249
    Nov 12 '18 at 3:06











  • please do not be editing the code in response to comments. Rather, add a 'EDIT' section that contains any edited code

    – user3629249
    Nov 12 '18 at 3:08






  • 1





    regarding: printf("%dt%dn", celcius, farenheit); the variables celcius and farenheit are float values. so the format string should be using %f, not %d

    – user3629249
    Nov 12 '18 at 3:12












  • 1





    You should post the code that causes the erroneous output (it seems from your text as if the output is not from the code you posted)

    – M.M
    Nov 12 '18 at 3:00











  • regarding: main() there are only two valid signatures for main they are int main( void ) and int main( int argc, char * argv )

    – user3629249
    Nov 12 '18 at 3:04











  • regarding: lower = -273.15; upper = 0; step = lower / -10; this is dividing a negative number by a negative number. The result will be positive

    – user3629249
    Nov 12 '18 at 3:06











  • please do not be editing the code in response to comments. Rather, add a 'EDIT' section that contains any edited code

    – user3629249
    Nov 12 '18 at 3:08






  • 1





    regarding: printf("%dt%dn", celcius, farenheit); the variables celcius and farenheit are float values. so the format string should be using %f, not %d

    – user3629249
    Nov 12 '18 at 3:12







1




1





You should post the code that causes the erroneous output (it seems from your text as if the output is not from the code you posted)

– M.M
Nov 12 '18 at 3:00





You should post the code that causes the erroneous output (it seems from your text as if the output is not from the code you posted)

– M.M
Nov 12 '18 at 3:00













regarding: main() there are only two valid signatures for main they are int main( void ) and int main( int argc, char * argv )

– user3629249
Nov 12 '18 at 3:04





regarding: main() there are only two valid signatures for main they are int main( void ) and int main( int argc, char * argv )

– user3629249
Nov 12 '18 at 3:04













regarding: lower = -273.15; upper = 0; step = lower / -10; this is dividing a negative number by a negative number. The result will be positive

– user3629249
Nov 12 '18 at 3:06





regarding: lower = -273.15; upper = 0; step = lower / -10; this is dividing a negative number by a negative number. The result will be positive

– user3629249
Nov 12 '18 at 3:06













please do not be editing the code in response to comments. Rather, add a 'EDIT' section that contains any edited code

– user3629249
Nov 12 '18 at 3:08





please do not be editing the code in response to comments. Rather, add a 'EDIT' section that contains any edited code

– user3629249
Nov 12 '18 at 3:08




1




1





regarding: printf("%dt%dn", celcius, farenheit); the variables celcius and farenheit are float values. so the format string should be using %f, not %d

– user3629249
Nov 12 '18 at 3:12





regarding: printf("%dt%dn", celcius, farenheit); the variables celcius and farenheit are float values. so the format string should be using %f, not %d

– user3629249
Nov 12 '18 at 3:12












2 Answers
2






active

oldest

votes


















1














Two problems: first of all, you are doing integer division which causes your quotient to be truncated. Multiply in your calculations by 9./5., not 9/5. The former gives the actual result, but the latter performs integer division



Your second problem is using %d as your format specifier. You need %f which is for float. Read the man pages for printf for more details on this.






share|improve this answer























  • Thanks, i don't even knew what "%d" means, this fixed my problem, now i will read part of manual about format specifier's.

    – Ablix Corner
    Nov 12 '18 at 3:14











  • when celcius is a float, the code celcius * 9/5 + 32 is correct, the associativity is (celcius * 9) / 5 etc.

    – M.M
    Nov 12 '18 at 3:38



















0














hope this can help you



#include <stdio.h>

int main(int argc,char **argv)

double celcius, farenheit;
double lower, upper, step;

lower = -273.15;
upper = 0;
step = lower / -10; // Dividing lower temperature by given number

celcius = lower;

while (celcius <= upper)
farenheit = celcius * 9/5 + 32;
printf("%5.2ft%5.2fn", celcius, farenheit);
celcius = celcius + step;

return 0;






share|improve this answer























  • That also help, and giving result without lots of numbers after the comma.

    – Ablix Corner
    Nov 12 '18 at 3:18






  • 2





    it looks like your answer helped the OP, but consider adding some explanatory notes along with your code; now that the OP has replied, you can even address your notes to the OP's delight about "without a lot of numbers after the comma"; in other words, it sounds like the OP is not yet familiar with the options for using the %f modifier in printf(); you can explain why you wrote that line the way you did, and link to useful documentation for printf(); TL; DR : please explain your code for the OP, who is just beginning with C

    – landru27
    Nov 12 '18 at 3:27

















2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














Two problems: first of all, you are doing integer division which causes your quotient to be truncated. Multiply in your calculations by 9./5., not 9/5. The former gives the actual result, but the latter performs integer division



Your second problem is using %d as your format specifier. You need %f which is for float. Read the man pages for printf for more details on this.






share|improve this answer























  • Thanks, i don't even knew what "%d" means, this fixed my problem, now i will read part of manual about format specifier's.

    – Ablix Corner
    Nov 12 '18 at 3:14











  • when celcius is a float, the code celcius * 9/5 + 32 is correct, the associativity is (celcius * 9) / 5 etc.

    – M.M
    Nov 12 '18 at 3:38
















1














Two problems: first of all, you are doing integer division which causes your quotient to be truncated. Multiply in your calculations by 9./5., not 9/5. The former gives the actual result, but the latter performs integer division



Your second problem is using %d as your format specifier. You need %f which is for float. Read the man pages for printf for more details on this.






share|improve this answer























  • Thanks, i don't even knew what "%d" means, this fixed my problem, now i will read part of manual about format specifier's.

    – Ablix Corner
    Nov 12 '18 at 3:14











  • when celcius is a float, the code celcius * 9/5 + 32 is correct, the associativity is (celcius * 9) / 5 etc.

    – M.M
    Nov 12 '18 at 3:38














1












1








1







Two problems: first of all, you are doing integer division which causes your quotient to be truncated. Multiply in your calculations by 9./5., not 9/5. The former gives the actual result, but the latter performs integer division



Your second problem is using %d as your format specifier. You need %f which is for float. Read the man pages for printf for more details on this.






share|improve this answer













Two problems: first of all, you are doing integer division which causes your quotient to be truncated. Multiply in your calculations by 9./5., not 9/5. The former gives the actual result, but the latter performs integer division



Your second problem is using %d as your format specifier. You need %f which is for float. Read the man pages for printf for more details on this.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 12 '18 at 3:06









stackptrstackptr

8,31023457




8,31023457












  • Thanks, i don't even knew what "%d" means, this fixed my problem, now i will read part of manual about format specifier's.

    – Ablix Corner
    Nov 12 '18 at 3:14











  • when celcius is a float, the code celcius * 9/5 + 32 is correct, the associativity is (celcius * 9) / 5 etc.

    – M.M
    Nov 12 '18 at 3:38


















  • Thanks, i don't even knew what "%d" means, this fixed my problem, now i will read part of manual about format specifier's.

    – Ablix Corner
    Nov 12 '18 at 3:14











  • when celcius is a float, the code celcius * 9/5 + 32 is correct, the associativity is (celcius * 9) / 5 etc.

    – M.M
    Nov 12 '18 at 3:38

















Thanks, i don't even knew what "%d" means, this fixed my problem, now i will read part of manual about format specifier's.

– Ablix Corner
Nov 12 '18 at 3:14





Thanks, i don't even knew what "%d" means, this fixed my problem, now i will read part of manual about format specifier's.

– Ablix Corner
Nov 12 '18 at 3:14













when celcius is a float, the code celcius * 9/5 + 32 is correct, the associativity is (celcius * 9) / 5 etc.

– M.M
Nov 12 '18 at 3:38






when celcius is a float, the code celcius * 9/5 + 32 is correct, the associativity is (celcius * 9) / 5 etc.

– M.M
Nov 12 '18 at 3:38














0














hope this can help you



#include <stdio.h>

int main(int argc,char **argv)

double celcius, farenheit;
double lower, upper, step;

lower = -273.15;
upper = 0;
step = lower / -10; // Dividing lower temperature by given number

celcius = lower;

while (celcius <= upper)
farenheit = celcius * 9/5 + 32;
printf("%5.2ft%5.2fn", celcius, farenheit);
celcius = celcius + step;

return 0;






share|improve this answer























  • That also help, and giving result without lots of numbers after the comma.

    – Ablix Corner
    Nov 12 '18 at 3:18






  • 2





    it looks like your answer helped the OP, but consider adding some explanatory notes along with your code; now that the OP has replied, you can even address your notes to the OP's delight about "without a lot of numbers after the comma"; in other words, it sounds like the OP is not yet familiar with the options for using the %f modifier in printf(); you can explain why you wrote that line the way you did, and link to useful documentation for printf(); TL; DR : please explain your code for the OP, who is just beginning with C

    – landru27
    Nov 12 '18 at 3:27















0














hope this can help you



#include <stdio.h>

int main(int argc,char **argv)

double celcius, farenheit;
double lower, upper, step;

lower = -273.15;
upper = 0;
step = lower / -10; // Dividing lower temperature by given number

celcius = lower;

while (celcius <= upper)
farenheit = celcius * 9/5 + 32;
printf("%5.2ft%5.2fn", celcius, farenheit);
celcius = celcius + step;

return 0;






share|improve this answer























  • That also help, and giving result without lots of numbers after the comma.

    – Ablix Corner
    Nov 12 '18 at 3:18






  • 2





    it looks like your answer helped the OP, but consider adding some explanatory notes along with your code; now that the OP has replied, you can even address your notes to the OP's delight about "without a lot of numbers after the comma"; in other words, it sounds like the OP is not yet familiar with the options for using the %f modifier in printf(); you can explain why you wrote that line the way you did, and link to useful documentation for printf(); TL; DR : please explain your code for the OP, who is just beginning with C

    – landru27
    Nov 12 '18 at 3:27













0












0








0







hope this can help you



#include <stdio.h>

int main(int argc,char **argv)

double celcius, farenheit;
double lower, upper, step;

lower = -273.15;
upper = 0;
step = lower / -10; // Dividing lower temperature by given number

celcius = lower;

while (celcius <= upper)
farenheit = celcius * 9/5 + 32;
printf("%5.2ft%5.2fn", celcius, farenheit);
celcius = celcius + step;

return 0;






share|improve this answer













hope this can help you



#include <stdio.h>

int main(int argc,char **argv)

double celcius, farenheit;
double lower, upper, step;

lower = -273.15;
upper = 0;
step = lower / -10; // Dividing lower temperature by given number

celcius = lower;

while (celcius <= upper)
farenheit = celcius * 9/5 + 32;
printf("%5.2ft%5.2fn", celcius, farenheit);
celcius = celcius + step;

return 0;







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 12 '18 at 3:14









lavenderwhalavenderwha

11




11












  • That also help, and giving result without lots of numbers after the comma.

    – Ablix Corner
    Nov 12 '18 at 3:18






  • 2





    it looks like your answer helped the OP, but consider adding some explanatory notes along with your code; now that the OP has replied, you can even address your notes to the OP's delight about "without a lot of numbers after the comma"; in other words, it sounds like the OP is not yet familiar with the options for using the %f modifier in printf(); you can explain why you wrote that line the way you did, and link to useful documentation for printf(); TL; DR : please explain your code for the OP, who is just beginning with C

    – landru27
    Nov 12 '18 at 3:27

















  • That also help, and giving result without lots of numbers after the comma.

    – Ablix Corner
    Nov 12 '18 at 3:18






  • 2





    it looks like your answer helped the OP, but consider adding some explanatory notes along with your code; now that the OP has replied, you can even address your notes to the OP's delight about "without a lot of numbers after the comma"; in other words, it sounds like the OP is not yet familiar with the options for using the %f modifier in printf(); you can explain why you wrote that line the way you did, and link to useful documentation for printf(); TL; DR : please explain your code for the OP, who is just beginning with C

    – landru27
    Nov 12 '18 at 3:27
















That also help, and giving result without lots of numbers after the comma.

– Ablix Corner
Nov 12 '18 at 3:18





That also help, and giving result without lots of numbers after the comma.

– Ablix Corner
Nov 12 '18 at 3:18




2




2





it looks like your answer helped the OP, but consider adding some explanatory notes along with your code; now that the OP has replied, you can even address your notes to the OP's delight about "without a lot of numbers after the comma"; in other words, it sounds like the OP is not yet familiar with the options for using the %f modifier in printf(); you can explain why you wrote that line the way you did, and link to useful documentation for printf(); TL; DR : please explain your code for the OP, who is just beginning with C

– landru27
Nov 12 '18 at 3:27





it looks like your answer helped the OP, but consider adding some explanatory notes along with your code; now that the OP has replied, you can even address your notes to the OP's delight about "without a lot of numbers after the comma"; in other words, it sounds like the OP is not yet familiar with the options for using the %f modifier in printf(); you can explain why you wrote that line the way you did, and link to useful documentation for printf(); TL; DR : please explain your code for the OP, who is just beginning with C

– landru27
Nov 12 '18 at 3:27



Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Malaysia to Papua New Guinea by motorcycle?

PHP code is not being executed, instead code shows on the page