Skip to content

Commit

Permalink
ex13 init
Browse files Browse the repository at this point in the history
  • Loading branch information
jessewmc committed Jul 28, 2014
1 parent 8d6fd5d commit c05c918
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CFLAGS=-Wall -g

all: ex1 ex3 ex4 ex5 ex6 ex7 ex8 ex9 ex10 ex11 ex12
all: ex1 ex3 ex4 ex5 ex6 ex7 ex8 ex9 ex10 ex11 ex12 ex13


clean:
Expand Down
Binary file modified ex1
Binary file not shown.
Binary file modified ex10
Binary file not shown.
Binary file modified ex11
Binary file not shown.
Binary file modified ex12
Binary file not shown.
Binary file added ex13
Binary file not shown.
51 changes: 51 additions & 0 deletions ex13.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#include <stdio.h>

int main(int argc, char* argv[]){
if(argc != 2){
printf("ERR yo need a arg\n");
return 1;
}

int i = 0;
for(i = 0; argv[1][i] != '\0'; i++){
char letter = argv[1][i];

switch(letter) {
case 'a':
case 'A':
printf("%d: 'A'\n", i);
break;

case 'e':
case 'E':
printf("%d: 'E'\n", i);
break;

case 'i':
case 'I':
printf("%d: 'I'\n", i);
break;

case 'o':
case 'O':
printf("%d: 'o'\n", i);
break;

case 'u':
case 'U':
printf("%d: 'u'\n", i);
break;

case 'y':
case 'Y':
if(i > 2){
printf("%d: 'Y'\n", i);
}
break;

default:
printf("%d: %c no vowel\n", i, letter );
}
}
return 0;
}
Binary file modified ex3
Binary file not shown.
Binary file modified ex4
Binary file not shown.
Binary file modified ex5
Binary file not shown.
Binary file modified ex6
Binary file not shown.
Binary file modified ex7
Binary file not shown.
Binary file modified ex8
Binary file not shown.
Binary file modified ex9
Binary file not shown.

0 comments on commit c05c918

Please sign in to comment.