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)); }
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]); }
Input: arr = {'a', 'b'}, length = 3
Output: aaa aab aba abb baa bab bba bbb