This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Programming Diversions and the fly likes c programming Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "c programming" Watch "c programming" New topic
Author

c programming

sree ramkumar
Greenhorn

Joined: Feb 22, 2007
Posts: 4
sir, i have attened one interview.they rise question from c programming.i answer all question, can't able to answer one question that is
"WHICH MATHEMATICAL OPERATOR IS NOT AVAILABLE IN C PROGRAMMING ". REQUEST YOU REPLY...
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1012
    
    3
Exponentiation? There is no single operator in C that does that operation.

BUT... is there an explicit real-world exponentiation "operator"? That operation is implied by the relative position and size of the terms involved without any intervening symbol (such as the + for addition).

Also, even though exponentiation isn't built into C, there is a standard library function that performs the operation, which comes with every C ompiler I've ever used.
Anand Hariharan
Rancher

Joined: Aug 22, 2006
Posts: 257

Originally posted by Ryan McGuire:

BUT... is there an explicit real-world exponentiation "operator"? That operation is implied by the relative position and size of the terms involved without any intervening symbol (such as the + for addition).


Perhaps not in the real-world language of mathematics, but there are reasonably main-stream programming languages that define an operator for exponentiation. Examples are ^ and **.

I guess C does not have an operator because there is no mainstream hardware / instruction set that includes an instruction for exponentiation.


"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- Antoine de Saint-Exupery
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: c programming