W4LABB F6 Hannah Jeg320869
W4LABB F6 Hannah Jeg320869
Write a C program to print a block F using the hash (#), where the F has a height of seven characters
and width of five and six characters. And also print a very large 'C'.*/
#include<stdio.h>
int main ()
printf("######\n#\n#\n#####\n#\n#\n#\n\n\n");
return 0;
}
/*2.Write a C program to compute the perimeter and area of a rectangle with a height of 7 inches and
width of 5 inches*/
#include<stdio.h>
int main ()
int h=7;
int w=5;
int p=2*(h+w);
int a=h*w;
return 0;
/*3.Write a C program that accepts an employee's ID, total worked hours in a month and the amount he
received per hour. Print the ID and salary (with two decimal places) of the employee for a particular
month.*/
#include<stdio.h>
int main ()
char ID[10];
int wh;
int ah;
scanf("%s",ID);
scanf("%d",&wh);
printf("\nSalary amount/hr:");
scanf("%d",&ah);
printf("Employees ID:%s\n",ID);
float s=wh*ah;
printf("Salary= U$ %.2f",s);
return 0;
/*4. Write a C program to read an amount (integer value) and break the amount into the
#include<stdio.h>
int main()
int a;
printf("Enter the amount:");
scanf("%d",&a);
int n=a/100;
a=a-(n*100);
n=a/50;
a=a-(n*50);
n=a/10;
a=a-(n*10);
n=a/5;
a=a-(n*5);
n=a/2;
a=a-(n*2);
n=0;
return 0;
}
/*5. Write a C program to convert a given integer (in days) to years, months and days,
assuming that all months have 30 days and all years have 365 days.*/
#include<stdio.h>
int main()
int d;
scanf("%d",&d);
int y=d/365;
printf("\n%d Year(s).",y);
d=d-(y*365);
y=d/30;
printf("\n%d Month(s).",y);
d=d-(y*30);
printf("\n%d Day(s).",d);
return 0;
}
/*6. Write a C program to check if two numbers in a pair are in ascending order or descending
order.*/
#include<stdio.h>
int main()
int a,b;
scanf("%d",&a);
scanf("%d",&b);
if (a<b)
else
return 0;