Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void recomendacao (float md)
- {
- if (md>=9)
- printf("Recomendacao: 30%% de bolsa.\n");
- else
- if (md>=8)
- printf("Recomendacao: 10%% de bolsa.\n");
- else
- if (md>=7)
- printf("Recomendacao: 5%% de bolsa.\n");
- else
- printf("Recomendacao: 0%% de bolsa.\n");
- }
- int matricula (int *n, int *d, int *x)
- {
- printf("Entre com o curso do aluno:\n");
- scanf("%d", n);
- printf("Entre com o o trimestre:\n");
- scanf("%d", d);
- printf("Entre com um numero de 1 a 90:\n");
- scanf("%d", x);
- if (*n!=20 || *n!=21 || *n!=22 || *n!=23 || *n!=24 || *d!=1 || *d!=2 || *d!=3 || *d!=4 || *x<1 || *x>90)
- return 0;
- else
- return 1;
- }
- void curso (int n)
- {
- if (n==20)
- printf ("Informatica");
- else
- if (n==21)
- printf ("Medicina");
- else
- if (n==22)
- printf ("Direito");
- else
- if (n==23)
- printf ("Engenharia");
- else
- printf ("Letras");
- }
- int main (void)
- {
- int retorno, n_, d_, x_;
- float media;
- retorno = matricula (&n_, &d_, &x_);
- while (retorno==1)
- {
- printf("entre com a media geral do aluno:\n");
- scanf("%f", &media);
- printf ("matricula: %d%d%d", n_, d_, x_);
- curso (n_);
- recomendacao (media);
- retorno = matricula (&n_, &d_, &x_);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement