Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <unistd.h>
- #include <stdio.h>
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- int calification(int note);
- int show(char *msg);
- int main(void)
- {
- calification(77);
- return 0;
- }
- int calification(int note)
- {
- char *msg_dos= " ESTA MAL INTRODUCIDA LA NOTA";
- char *msg_three= " APROBADO/A";
- char *msg_four= " SUSPENSO/A";
- if ((note >= 5) && (note <= 10))
- {
- show(msg_three+1);
- }
- else if (note >= 0 && note <= 4)
- {
- show(msg_four+1);
- }
- else if (note >10 || note < 0)
- {
- show(msg_dos+1);
- }
- return 0;
- }
- int show(char *msg)
- {
- if(msg != "/n")
- {
- write(1, msg, 1);
- show(msg+1);
- }
- else
- {
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement