#include <stdio.h>
#include <stdlib.h>
struct mhs { char name[50];
int nim;
float uts;
float uas;
}y;
main()
{
float ntot;
printf("------- Program By --------\n\n\n");
printf("Nama : Timothy Kawulusan \n");
printf("NIM : 1101164456\n\n\n");
printf("------- Press enter key to continue --------\n");
getchar();
system("cls");
printf("------- Program Input Output Nilai --------\n\n\n");
printf("--Input--\n");
printf("Nama:\t");
gets( y.name );
printf("NIM : \t");
scanf("%d", &y.nim);
printf("Nilai UTS : \t");
scanf("%f",&y.uts);
printf("Nilai UAS : \t");
scanf("%f",&y.uas);
system("cls");
printf("------- Program Input Output Nilai --------\n\n\n");
printf("--Output--\n");
printf("Nama:\t");
puts(y.name);
printf("NIM: \t");
printf("%d", y.nim);
printf("\n");
printf("Nilai UTS:\t");
printf("%.2f",y.uts);
printf("\n");
printf("Nilai UAS:\t");
printf("%.2f",y.uas);
printf("\n");
(ntot = ((y.uas+y.uts)*0.5));
printf("Nilai Total:\t");
printf("%.2f", ntot);
printf("\n");
return 0;
}
Komentar
Posting Komentar
Yuk saling mengisi kekurangan setiap orang :), Kritik dan saran selalu diterima kok! :)