Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Girri M Palaniyapan](https://uploads.teamtreehouse.com/production/profile-photos/1229512/micro_1270683_10153204996965338_1664753481_o.jpg)
Girri M Palaniyapan
7,829 PointsWhat happens if we want multiple integers to be printed in a statement? How would the syntax be different?
Supposing I have
int days_in_a_week = 7; int hours_in_a_day = 24;
How can I express both these int using %d?
Thanks :)
![Girri M Palaniyapan](https://uploads.teamtreehouse.com/production/profile-photos/1229512/micro_1270683_10153204996965338_1664753481_o.jpg)
Girri M Palaniyapan
7,829 PointsThanks Ryan and Abhishek!
1 Answer
![kasaltrix](https://secure.gravatar.com/avatar/709439ed35572ea1e762fd6932d9026a?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
kasaltrix
9,491 PointsHi there, I guess you want to display both days_in_a_week and hours_in_a_day using the same output statement. Well if that is the case, it can be done as:
printf("There are %d days in a week and %d hours in a day",days_in_a_week,hours_in_a_day);
Hope this helps :)
Ryan Jin
15,337 PointsRyan Jin
15,337 PointsIn swift, you just simply add () outside the variable or constant you want to display. So it should look similar to
In objective C, it is kind of different, instead, you add %d in the string where you want to display your data, and the second %d will require you to add a second argument. So it will look like