+ 1

Can anyone tell me the difference(if any) b/w the following set of statements:

Q1-"%d" vs " %d" Q2-"%d-%d-%d" vs "%d -%d -%d" Q3-"%f,%f" vs "%f ,%f"

14th Mar 2017, 7:30 AM
vimal tomar
vimal tomar - avatar
1 Réponse
+ 3
main() { int a = 1,b = 2 , c = 3; float x = 3.14 , y = 6.17 ; puts("Q1"); printf("%d",a); puts(""); printf(" %d",a); puts("Q2"); printf("%d-%d-%d",a,b,c); puts(""); printf("%d -%d -%d",a,b,c); puts("Q3"); printf("%f,%f",x,y); puts(""); printf ("%f ,%f",x,y); } Run above code as it is to see the answer replace printf with scanf to see difference while taking input...
14th Mar 2017, 9:06 AM
Shirious
Shirious - avatar