Jump to content

Temperature conversion: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 228:
 
Р9 = tºF.
=={{header|Objective-C}}==
<lang objc>#import <Foundation/Foundation.h>
 
int main(int argc, const char * argv[])
{
@autoreleasepool {
if(argc > 1)
{
NSString *arg1 = [NSString stringWithCString:argv[1] encoding:NSUTF8StringEncoding];
// encoding shouldn't matter in this case
double kelvin = [arg1 doubleValue];
NSLog(@"K %.2f",kelvin);
NSLog(@"C %.2f\n", kelvin - 273.15);
NSLog(@"F %.2f\n", (kelvin * 1.8) - 459.67);
NSLog(@"R %.2f", kelvin * 1.8);
}
}
return 0;
}</lang>
 
=={{header|Perl 6}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.