Compare commits
No commits in common. "24d05e18d6e3a46572672e129495db91c3232c48" and "c71ffdd716440803fdc18ea12841b53f81099975" have entirely different histories.
24d05e18d6
...
c71ffdd716
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
*.out
|
|
BIN
DeitelC/Chapter4/a.out
Normal file
BIN
DeitelC/Chapter4/a.out
Normal file
Binary file not shown.
@ -1,20 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int main(void) {
|
|
||||||
puts("Enter 5 different integers between 1 - 30!");
|
|
||||||
for(int i = 0; i < 5; i++) {
|
|
||||||
printf("Enter %d. integer: ",(i+1));
|
|
||||||
int j;
|
|
||||||
if(!scanf("%d", &j)) {
|
|
||||||
puts("Enter a valid integer!");
|
|
||||||
} else if((j < 1 || j > 30)) {
|
|
||||||
puts("Integer not between 1-30!");
|
|
||||||
}
|
|
||||||
|
|
||||||
for(int t = 0; t < j; t++) {
|
|
||||||
printf("%s","*");
|
|
||||||
}
|
|
||||||
puts("");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int main (void){
|
|
||||||
int i, j;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int main(void) {
|
|
||||||
|
|
||||||
int accNum;
|
|
||||||
float limit, debt;
|
|
||||||
puts("Enter 3 customer details!");
|
|
||||||
for(int counter = 0; counter < 3; counter++){
|
|
||||||
puts(" ");
|
|
||||||
puts("Enter account number: ");
|
|
||||||
int a = scanf("%d", &accNum);
|
|
||||||
puts("Enter credit limit: ");
|
|
||||||
int b = scanf("%f", &limit);
|
|
||||||
puts("Enter current debt: ");
|
|
||||||
int c = scanf("%f", &debt);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!a || !b || !c) {
|
|
||||||
puts ("Enter valid data!");
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("Account number: %d, Account old credit limit: %.2f, Account current debt: %.2f.\n", accNum, limit, debt);
|
|
||||||
|
|
||||||
if(limit/2 < debt) {
|
|
||||||
puts("WARNING! ACCOUNT DEBT MORE THAN NEW LIMIT!");
|
|
||||||
printf("New credit limit: %.2f, Current debt: %.2f\n", (limit/2), debt);
|
|
||||||
} else {
|
|
||||||
printf("New credit limit: %.2f, Current debt: %.2f\n", (limit/2), debt);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user