updated scripts to create bin dir, dividableBy7 name change

This commit is contained in:
Christoph J. Scherr 2022-11-25 23:17:55 +01:00
parent 0e95262ce0
commit 9e52cac031
5 changed files with 3 additions and 29 deletions

View File

@ -1,29 +0,0 @@
/*
* lower and upper end as user input
* use a for loop to output all numbers for which 7|x is true.
*/
#include <stdio.h>
int main() {
int a,b;
printf("input lower end:\n");
fflush(stdin);
scanf("%d",&a);
printf("input upper end:\n");
fflush(stdin);
scanf("%d",&b);
printf("inputs: %d %d\n", a, b);
for(int i=a; i<=b; i++){
if(i%7==0)
printf("%d ", i);
if(i==b)
printf("\n");
}
// reverse array order
return 0;
}

View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
mkdir -p bin
returnCode=0 returnCode=0
echo -e "compiling all files in working directory $(pwd)\n" echo -e "compiling all files in working directory $(pwd)\n"
for file in $(/bin/ls *.c); for file in $(/bin/ls *.c);

View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
mkdir -p bin
noext=$(echo "$1" | cut -f 1 -d '.') noext=$(echo "$1" | cut -f 1 -d '.')
echo "compiling $1 ..." echo "compiling $1 ..."
gcc $1 -o bin/$noext -lm gcc $1 -o bin/$noext -lm

View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
mkdir -p bin
echo "compiling $1 ..." echo "compiling $1 ..."
noext=$(echo "$1" | cut -f 1 -d '.') noext=$(echo "$1" | cut -f 1 -d '.')
gcc $1 -o bin/$noext -lm gcc $1 -o bin/$noext -lm