Here are two simple exercise on C programming language. Please give me the coding for these program(at least for the second exercise)(The second one is the most important exercise)
Exercise 1:
Write a program to input a temperature reading in either Celsius(c) or Fahrenheit(f) scale and convert it to the other scale. The temperature reading consist of a decimal integer followed by letter “F” or “f” if the temperature is in Fahrenheit scale or letter “C” or “c” if it is in Celsius scale. You may use a similar format for the output of the program.
Note: c=5*(f-32)/9
$ ./a.out
Temperature reading: 100C
212F
$ ./a.out
Temperature reading: 100F
37C
Exercise 2:
Give a date as a triplet of numbers(y,m,d), with y indicating the year, m the month(m=1 for January, m=2 for February, etc.), and d the day of the month, the corresponding day of the week f(f=0 for Sunday, f=1 for Monday, etc.), can be found as follows:
(a)if m<3 let m=m+12 and let y=y-1
(b)let a=2m+6(m+1)/10
(c)let b=y+y/4-y/100+y/400
(d)let f1=d+a+b+1
(e)let f=f1 mod 7
(f)stop.
Write a program that will read a date and print the corresponding day of the week. All divisions indicated above are integer divisions.



Exercise 1:
Write a program to input a temperature reading in either Celsius(c) or Fahrenheit(f) scale and convert it to the other scale. The temperature reading consist of a decimal integer followed by letter “F” or “f” if the temperature is in Fahrenheit scale or letter “C” or “c” if it is in Celsius scale. You may use a similar format for the output of the program.
Note: c=5*(f-32)/9
$ ./a.out
Temperature reading: 100C
212F
$ ./a.out
Temperature reading: 100F
37C
Exercise 2:
Give a date as a triplet of numbers(y,m,d), with y indicating the year, m the month(m=1 for January, m=2 for February, etc.), and d the day of the month, the corresponding day of the week f(f=0 for Sunday, f=1 for Monday, etc.), can be found as follows:
(a)if m<3 let m=m+12 and let y=y-1
(b)let a=2m+6(m+1)/10
(c)let b=y+y/4-y/100+y/400
(d)let f1=d+a+b+1
(e)let f=f1 mod 7
(f)stop.
Write a program that will read a date and print the corresponding day of the week. All divisions indicated above are integer divisions.





Meka next week submit karanna one ne!!