Tugas 8.1 Algoritma

Run Settings
LanguageC++
Language Version
Run Command
#include <stdio.h> int main() { int n; int absen[25], tugas[25], uts[25], uas[25]; float total[25]; printf("=============================================\n"); printf(" Contoh Program Array \n"); printf("=============================================\n"); printf("Masukkan Jumlah Data\t: "); scanf("%d", &n); for (int i = 0; i < n; i++) { printf("\n============================================="); printf("\nData ke-%d\n", i + 1); printf("Masukkan Nilai Absen \t: "); scanf("%d", &absen[i]); printf("\nMasukkan Nilai Tugas \t: "); scanf("%d", &tugas[i]); printf("\nMasukkan Nilai UTS \t: "); scanf("%d", &uts[i]); printf("\nMasukkan Nilai UAS \t: "); scanf("%d", &uas[i]); total[i] = (absen[i] + tugas[i] + uts[i] + uas[i]) / 4.0; } printf("\n============================================="); printf("\n Data Yang Anda Masukkan "); printf("\n============================================="); printf("\nNo Absen Quis Tugas UTS UAS Total\n"); for (int i = 0; i < n; i++) { printf("%-3d %-6d %-5d %-6d %-5d %-5d %.2f\n", i + 1, absen[i], absen[i], tugas[i], uts[i], uas[i], total[i]); } printf("=============================================\n"); printf("Nama\t: rendy wicaksono\n"); printf("Email\t: rendywicaksono12@gmail.com\n"); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines