Explain how can I right-justify a string?
Answer / Bhagya Laxmi Upadhyay
In C, you can use the `printf()` function's format specifier `%*s` to specify the total width of the string and right-justify it. For example, `printf("%.12s", "Hello World");` will print Hello World with a minimum width of 12 characters and right justification.
| Is This Answer Correct ? | 0 Yes | 0 No |
what do u mean by Direct access files? then can u explain about Direct Access Files?
How do you generate random numbers in C?
pascal triangle program
Difference between C and Embedded C?
write a program to compare 2 numbers without using logical operators?
I use turbo C which allocates 2 bytes for integers and 4 bytes for long. I tried to declare array of size 500000 of long type using the following code... long *arr; arr=(long *)(malloc)(500000 * sizeof(long)); It gives a warning that "Conversion may lose significant digits in function main"... And the resulting array size was very less around 8400 as compared to 500000. Any suggestions will be welcomed....
What is the use of function in c?
Why is void main used?
Tell us something about keyword 'auto'.
Can I initialize unions?
What is the use of gets and puts?
4) Write a program that takes a 5 digit number and calculates 2 power that number and prints it. i have done maximum par but i m findind problem in the commented area. please help...