this should be done in C language! thanks. //Lab6 Q1 #include <stdio.h> int main
ID: 3678865 • Letter: T
Question
this should be done in C language! thanks. //Lab6 Q1 #include <stdio.h> int main() { int size; printf("Please enter the size of the box: "); scanf("%d", &size); //top row for(int i = 1; i <= size; i++) { printf("@"); } printf(" "); //Center for(int j = 1; j <= (size - 2); j++) { for(int k = 1; k <= (size - 2); k++) { } } //bottom row for(int i = 1; i <= size; i++) { printf("@"); } printf(" "); return 0; } //Lab6 Q2 #include <stdio.h> #include <math.h> int main() { int a, b, c; double d, r, r1, r2; printf("Please enter value of a: "); scanf("%d", &a); //you finish b, c; d = b*b - 4*a*c; if(d < 0) { printf("The roots are imaginary. "); return 0; } else if(d == 0) { r = -b/(2.0*a); printf("The roots are equal and they are %f. ", r); } //you finish it up return 0; }
Explanation / Answer
1.Output:
@@@@@
@@@@@
2.Output:
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.