Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Tanuj Wadhi
869 PointsNew at coding; doubt about code..
Im using Xcode 5, language C. and my input was:
include <stdio.h>
int main()
{ int i =2; int result;
while (i>0) {
result=i*i;
printf("%20d ^ 2 = %20d\n", i, result);
i = i*i;
}
return 0;
}
thats my code.
and my result is:
2 ^ 2 = 4 4 ^ 2 = 16 16 ^ 2 = 256 256 ^ 2 = 65536 65536 ^ 2 = 0
Just wondering why the code couldn't square "65536".
2 Answers

Mohd Maqbool Alam
Full Stack JavaScript Techdegree Student 5,715 PointsCHANGE TO FLOAT OR MORE LARGER VALUE TYPE

Mohd Maqbool Alam
Full Stack JavaScript Techdegree Student 5,715 Pointsbecause of its type INTEGER