What is the difference between %d and %*d in C
Answers were Sorted based on User's Feedback
Answer / meruva
%d means it prints only given value,
and %*d means it prints garbage value.
for eg: //it prints i value is=10
int i=10;
printf("i value is=%d",i);
//it prints garbage value
int i=10;
printf("i value is=%*d",i);
| Is This Answer Correct ? | 5 Yes | 3 No |
Answer / nithya
%d print the value for example
int x=2;
printf("x=%d",x);
output:
x=2
%*d print the value for example
int x=2;
printf("x=%*d",x);
output:
x= 2
the output two space(x=2) next the value will be display
(x=6) the output 6 space next the value will be display
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ram
%d prints the given value,
%*d... used to print the mentioned length of given value
| Is This Answer Correct ? | 0 Yes | 5 No |
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
how i m write c program 1.check prime number 2.prime number series
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL
Do you know what are the properties of union in c?
What does %d do?
What is a volatile keyword in c?
Do you know the difference between malloc() and calloc() function?
What are the __date__ and __time__ preprocessor commands?
How many ways are there to swap two numbers without using temporary variable? Give the each logic.
Here is a good puzzle: how do you write a program which produces its own source code as output?
enum { SUNDAY, MONDAY, TUESDAY, }day; main() { day =20; printf("%d",); getch(); } what will be the output of the above program
Is reference used in C?