println than printf , when i asked him why?
He replied " Cus printf has some issues with java, so he recommends using print or println than printf?
Do you think there is any issue?
also, Can you tell me which is most important situation when we use printf?
example of teacher:
System.out.printf (" The principal is %d \n number of years: %d, \nrate is: %f \n The calculated simple interest is:%f\n ", principal,noy,rate,si);
where principal, noy is int and rate and si is double.
System.out.println (" The principal is"+principal+ "\n number of years:" +noy+ "\nrate is:"+rate+"\n The calculated simple interest is:"+si);
Both works, but which is better to use in real life programming??
It shouldn't piss him off if you merely said something like, "I'm curious, what are the issues with printf, so I can avoid problems in my future programs?" (Unless he really doesn't know and is just blowing smoke - then he might be pissed off)
Fixing incorrect format strings is definitely more trouble than using println with concatenation, so maybe he just wants to avoid a lot of the hassle with it.
"Issues" is a rather broadly generic word, so he could be referring to any number of things. I'm curious what they might be.
Edit: I do agree though that you should just do it the way the prof wants it done. He's the gatekeeper you have to pass for that 'A'.
Yes, please do ask him about this, and let us know what he says.
I don't think it's likely that you can annoy a teacher by showing an interest and trying to learn more. It might be best to pursue it during office hours or after class, because he's probably got plenty of material to go over in his lectures, but do follow up on it.
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...