Hello,
I want to print a line like this using a printf statement:
How can I do this using a for statement?Code:+0000 +0000 +0000 +0000
Please Help!
Hello,
I want to print a line like this using a printf statement:
How can I do this using a for statement?Code:+0000 +0000 +0000 +0000
Please Help!
Show your attempt. This is your 12th post here. You know better. Stop being lazy.
If you understand what you're doing, you're not learning anything.
i have tried numerous times, i have tried many things
it just isn't happening
There, I did it somehow.
But I don't understand how the "%+05d" works.
Code:#include<stdio.h> int main() { int a = 0; for( int i = 0; i <= 4; i++ ) { printf( " %+05d ", a ); } printf( "\n\n\n\n" ); }
Here you will find all the explanation about "%+05d" and many other things : www.csd.uoc.gr/~hy150b/spring-2011/lectures/secrets_of_printf.pdf