K
karthikbalaguru
Hi,
I have a query based on the format
specifier in printf.
Consider the below code -
#include<stdio.h>
int main(void)
{
char *s = "Hello World";
printf("%15.11s\n",s);
printf("%-15.11s\n",s);
return 0;
}
I got the below output :-
Hello World
Hello World
Is ther any specifier to print the Hello World
such that Hello goes to the left extreme and
World to the Right extreme with spaces inbetweeen
them ?
That is, i am expecting the below output using
any of the format specifier in printf :-
Hello World
Thx in advans,
Karthik Balaguru
I have a query based on the format
specifier in printf.
Consider the below code -
#include<stdio.h>
int main(void)
{
char *s = "Hello World";
printf("%15.11s\n",s);
printf("%-15.11s\n",s);
return 0;
}
I got the below output :-
Hello World
Hello World
Is ther any specifier to print the Hello World
such that Hello goes to the left extreme and
World to the Right extreme with spaces inbetweeen
them ?
That is, i am expecting the below output using
any of the format specifier in printf :-
Hello World
Thx in advans,
Karthik Balaguru