- 1
Solution ?
#include<stdio.h> int main() { char *s = "Geeks Quiz"; int n = 7; printf("%.*s", n, s); return 0; }
6 odpowiedzi
+ 6
You have Code playground, why don't you write code for the exercise!👍
+ 6
Hi Vashisth Malik,
In Sololearn, you can coding in Sololearn Code Playground.
https://code.sololearn.com/#c++
+ 6
You can use an asterisk (*) to pass the width specifier/precision to printf(), rather than hard coding it into the format string!
https://stackoverflow.com/questions/7899119/what-does-s-mean-in-printf
+ 4
Try to play with ThisOne! ;)👍😉
https://code.sololearn.com/clAAj9H0AM7w/?ref=app
+ 1
Ok, can you tell what is going on in printf ?
+ 1
Solution??
Void print(int n)
{
if(n<0)
Return;
Printf("%d",n);
...........(n-1);
}
Output: