Function Main
Declare Integer A
Declare Integer B
Declare Integer C
Declare Integer Delta
Declare Real X1
Declare Real X2
Output "Enter coefficient of X^2:"
Input A
Output "Enter coefficient of X:"
Input B
Output "Enter known term:"
Input C
If A = 0
Output "Equarion:"
Assign X1 = -C / B
Output "The solution is X = " & X1
Else
Assign Delta = B^2 - 4*A*C
If Delta < 0
Output "There are no real solutions"
Else
If Delta = 0
Assign X1 = -B / (2*A)
Output "Two real and coincident solutions"
Output "X1 = " & X1
Output "X2 = " & X1
Else
Assign X1 = -B - SQRT(Delta) / (2*A)
Assign X2 = -B + SQRT(Delta) / (2*A)
Output "Two real and distinct solutions"
Output "X1 = " & X1
Output "X2 = " & X2
End
End
End
End
Function Main
Declare Integer y
Declare Integer w
Declare Integer d
Declare Integer a
Output "Enter total number of days:"
Input d
Assign y = d / 365
Assign a = d MOD 365
Assign w = a / 7
Assign d = a MOD 7
Output "Years:" & ToString(y) & ToChar(10) & ToChar(13) & "Weeks: " & ToString(w) & ToChar(10) & ToChar(13) & "Days: " & ToString(d)
End
#include <stdio.h>
int main() {
int y;
int w;
int d;
int a;
printf("Enter total number of days:\n");
scanf("%d", &d);
y = (int) ((double) d / 365);
a = d % 365;
w = (int) ((double) a / 7);
d = a % 7;
printf("Years: %d\nWeeks: %d\nDays: %d\n", y, w, d);
return 0;
}