-
Notifications
You must be signed in to change notification settings - Fork 388
C programming #162
Comments
That will help you In c the leading 0 isn't recognized by the compiler. If you want to show it i would suggest you printing it as a text and not as a number. |
You cannot print 0 in C language as a integer with output you want. If you want to print it you can do using an array or string. |
@leakna, In the case of Integer or float data type, if you add 0 at the front of the number it will not print in the output and print the rest of the number without zero on the output screen. If you want to print zero on the output screen with your number as it is, you have to use string (i.e. array of char) Instead of using Integer. Hope this will help you. Here is the code for it in C - #include <stdio.h> |
I had worked in decoder android APK, #include <stdio.h> 0124 |
Yeah... |
0124=124. Since your input and output are integers and not strings, it is as expected. |
How to enable or disable usb port using the c programming language |
/*if 0 is in first place of numbers i.e 012 or 01 etc in a integer variable then the compiler doesnot reconige it so to print that kind of output use string |
In C programming, numbers are operated and set to in Decimal value but 0 is considered as a octal value. so we should include "%#o" in printf statement. why '#' ? because it will include prefix of the number = 0123 which is 0 else it will only print 123. so your final code would be : |
int address=0124;
printf("%d",address);
Output=124
Why it ain't output 0 with all of those number?
The text was updated successfully, but these errors were encountered: