Posts

Showing posts with the label Semester1

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 +...

Convert Fahrenheit to Celsius (Chapter 1 Program 4)

Image
Also visit our YouTube Channel Tech Eos     VISIT CHANNEL /* 4. Write a program to enter the temperature in Fahrenheit    and convert it to Celsius.[C = ((F-32)*5)/9]  */ #include<stdio.h> #include<conio.h> void main() { float fahrenheit , celsius ; clrscr(); printf("\nEnter temperature in fahrenheit : "); scanf("%f" , &fahrenheit); celsius = ( ( fahrenheit - 32 )*5 )/9 ; printf("\n\nAfter conversion Celsius = %f " , celsius); getch(); }

Chapter 1 Program 2

Image
Also visit our YouTube Channel Tech Eos     VISIT CHANNEL /*      2. Find the area and perimeter of square and rectangle. Input the side(s) through the keyboard.      */ #include<stdio.h> #include<conio.h> void main() { int a , area_of_square , perimeter_of_square ;   //FOR Square         // FOR Rectangle int length , width , area_of_rectangle , perimeter_of_rectangle;   clrscr(); printf("\nEnter value of a : "); scanf("%d" , &a); // area of square formula -->>   (a*a) area_of_square = (a*a); //perimeter of square formula -->> (4*a) perimeter_of_square = (4*a); printf("\n\nArea of Square    :  %d " , area_of_square ); printf("\nPerimeter of Square :  %d " ,                     ...

Chapter -1 Program -1

Image
Also visit our YouTube Channel Tech Eos    VISIT CHANNEL /* 1 . Find the Simple Interest. Inputs are principal amount,    period in year and rate of interest.    */ void main() { float principal_amount , rate_of_interest ; int peroid_in_year; float simple_interest ; clrscr(); printf("\nEnter principal amount : "); scanf("%f" , &principal_amount); printf("\nEnter rate of interest : "); scanf("%f" , &rate_of_interest); printf("\nEnter peroid of year   : "); scanf("%d" , &peroid_in_year); //    Simple Interest Fromula     (p*r*n)/100 simple_interest = ( principal_amount * rate_of_interest * peroid_in_year )/100; printf("\n\nSimple Interest is  %f " , simple_interest ); getch(); }