Question by jandrox_ox: What language to learn next? Software Engineer?
I am a undergrad student majoring in computer software engineer. In my university most courses are taught using java, and the faculty expects us to learn the other languages by ourself (they concentrate a lot on concepts, not the language itself).
So I was wondering, what language should I learn next? (I am interesting in embedded system programming as well as desktop applications and OS, is C# useful for embedded systems or is C the way to go?)
Please just in general tell me what language I should learn next, and after that…
Answer by XoaX.net
C, C++ and assembly.
Know better? Leave your own answer in the comments!
Question by rick m: for loops in c programming?
Calculate sin^2(x) approximately by using n terms (n>0) the Taylor series:
sin(x)=Sum[(-1)^k x^(2k+1)/(2k+1)!] (k goes from 0 to n-1)
Scan an integer value of n. Evaluate (2k+1)! by an embedded for-loop statement. And how do you compute a factorial in c programming?
Answer by The Phlebob
After geting the value of n from the user via the keyboard, you need a loop doing the summation for 0 to n-1. Inside this loop you need another loop that calculates (2k+1)!.
You calculate a factorial by its definition (n) * ( n-1 ) * ( n-2 )… 1
1. Define an accumulating variable and initialize it to n outside the loop.
2. Count down from n -1 to 1 rather than up to n.
3. In the factorial loop, multiply the accumulating variable by the current value of the loop variable and store the results back in the accumulating variable.
Hope that helps.
What do you think? Answer below!