Posts

Showing posts from April 7, 2020

Seconds to hours , minutes and seconds ( Chapter 2 Program 1 )

Image
Also visit our YouTube Channel Tech Eos     VISIT CHANNEL /* 1 . Write a program to accept number of seconds and display its corresponding hours, minutes and seconds.           */ #include<stdio.h> #include<conio.h> void main() { int seconds , minute , hour; clrscr(); printf("\nEnter seconds :  "); scanf("%d" , &seconds); hour    = seconds / 3600; seconds = seconds % 3600; minute  = seconds / 60; seconds = seconds % 60; printf("\n\n%d : %d : %d " , hour , minute , seconds); getch(); }

average temperature of five sunny days (Chapter 1 Program 10 )

Image
Also visit our YouTube Channel Tech Eos     VISIT CHANNEL /* 10. Writea program to find the average temperature of five sunny days. Assume the temperature in Celsius . */ #include<stdio.h> #include<conio.h> void main() { float temperature1 , temperature2 , temperature3 , temperature4; float temperature5 , average_temperature ; clrscr(); printf("\nEnter 1 temperature value : "); scanf("%f" , &temperature1 ); printf("\nEnter 2 temperature value : "); scanf("%f" , &temperature2 ); printf("\nEnter 3 temperature value : "); scanf("%f" , &temperature3 ); printf("\nEnter 4 temperature value : "); scanf("%f" , &temperature4 ); printf("\nEnter 5 temperature value : "); scanf("%f" , &temperature5 ); average_temperature = (temperature1 + temperature2 +...