top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

C Program that converts centigrade to fahrenheit?

+3 votes
146 views
C Program that converts centigrade to fahrenheit?
posted Apr 22, 2016 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Formula

(F-32)/9 = C/5
or 
F = 9C/5 + 32 

Sample Code

main()
{
  float c;
  scanf("%f", &c);
  printf("%f C = %f F", c, (9*C/5 + 32));
}
answer Apr 22, 2016 by Salil Agrawal
Similar Questions
–1 vote

Determine the set of inputs that will lead to SIGFPE (floating point exception) being triggered in following C program?

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
    if(argc != 3 || !atoi(argv[2]))
        return 1;
    return abs(atoi(argv[1])) / atoi(argv[2]);
}
+2 votes

Input:
arr = {'a', 'b'}, length = 3

Output:
aaa
aab
aba
abb
baa
bab
bba
bbb

...