You are on page 1of 2

#include <stdio.

h>
main()
{
int nis;
float uts,tugas,uas,quiz;
char nama[20];
printf("Masukan Sebuah nis:");scanf("%d",&nis);
printf("Masukan Sebuah nama:");scanf("%s",&nama);
printf("Masukan Sebuah tugas:");scanf("%f",&tugas);
printf("Masukan nilai uts:");scanf("%f",&uts);
printf("=================================\n");
printf("Nama
: %s\n",nama);
printf("tugas
: %f\n",tugas);
printf("=================================");
}

#include<stdio.h>
#include<conio.h>
main()
{
char nama[20];
float nilai,tugas,quiz,uts,uas;
int nis;
clrscr;
printf("Masukan nis :");scanf("%d",&nis);
printf("Masukan nama :");scanf("%s",&nama);
printf("Masukan Tugas :");scanf("%f",&tugas);
printf("Masukan quiz :");scanf("%f",&quiz);
printf("Masukan UTS :");scanf("%f",&uts);
printf("Masukan uas :");scanf("%f",&uas);
printf("=====================\n");
printf("nama
:% fs\n",nama);
printf("tugas
:%10.2f\n",tugas);
printf("quiz
:%10.2f\n",quiz);
printf("UTS
:%10.2f\n",uts);
printf("uas
:%10.2f\n",uas);
nilai=0.1*tugas+0.2*quiz+0.3*uts+0.4*uas;
printf("Nama :%s Mendapat Nilai :%5.2f\n",nama,nilai);
printf("=====================\n");
getche ();
}