in C language,. int var= 010; printf("%d",var); | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

in C language,. int var= 010; printf("%d",var);

How the o/p is getting 8???

7th Feb 2020, 3:38 PM
Bhargav Sai
Bhargav Sai - avatar
2 Answers
+ 4
It's octal representation of decimal value 8. this thread discusses the same, just in different language (java) https://www.sololearn.com/discuss/378895/?ref=app also read this article https://www.google.com/amp/s/www.geeksforgeeks.org/octal-numbers-c/amp/
7th Feb 2020, 3:49 PM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar
+ 2
Bhargav Sai , Not 100, It's 010. won't be hard to understand if you care to do some efforts from your side. At least read the article provided.
7th Feb 2020, 3:56 PM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar