+ 3
I need help with this!
The following variable has already been declared and assigned: countryPopulation = 3000009; using that variable(do not type the large number) along with text, finish the output statement to output the following: Chinaâs population was 3000009 in 2011. My code: printf(âChinaâs population was %dâ , countryPopulation); My output is : Chinaâs population was 3000009. But how I can add âin 2011â in my code?
13 Respostas
+ 6
Exactly like the rest of the text
"China's population was %d in 2011"
+ 4
You just need to write it this way:
printf("China's population was%d in 2011", countryPopulation);
+ 3
Thanks
+ 2
("%d is a lot", countryPopulation)
same format ("%d", varName)
+ 2
The code needs to be in one line. Along with the first one
+ 2
Then do it this way since you want everything on one line:
printf("China's population was %d in 2011. %d is a lot.", countryPopulation, countryPopulation);
+ 2
Same format, and you use \n for line breaks
+ 2
It works!
+ 2
Great!
+ 2
Hello
You can use this way:
int year = 2011;
printf("China's population was %d in %d", countryPopulation, year);
Good luck.
+ 1
So how can I output: 300009 is the popultion. 3000009 is a lot.
+ 1
Iâm canât get the second one
+ 1
Printf(â%d is the populationâ, countryPopulation);