This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Tampilkan postingan dengan label progam penghitungan nilai mahasiswa. Tampilkan semua postingan
Tampilkan postingan dengan label progam penghitungan nilai mahasiswa. Tampilkan semua postingan

Senin, 05 Maret 2012

progam penghitungan nilai mahasiswa

#include <stdio.h>
#include <stdlib.h>

int main () {
    //deklarasi variable
    int uts, uas, tgs;
    float na; char grade;
    //judul program
    printf("Perogram penghitung nilai mahasiswa\n\n");
    //input
    printf("masukan nilai uts : "); scanf("%d",&uts);
    printf("masukan nilai uas : "); scanf("%d",&uas);
    printf("masukan nilai tgs : "); scanf("%d",&tgs);
    //proses
    na=(float)(uts*40+uas*60+tgs*40)/(40+60+40);    //menghitung na
   
    if(uas ==0) grade='K';                         //menentukan grade
    else if (na>=85) grade='A';
         else if (na>=70) grade='B';
              else if (na>=56) grade='C';
                   else if (na>=40) grade='D';
                        else grade='E';
                       
    //output
    printf("\nNA = (%dx40+%dx60+%dx40)/(40+60+40) = %.3f\n",uts,uas,tgs,na);
    printf("grade = %c\n",grade);
    printf("\n\n");
    system ("pause");
    return(0);
}
/*By D-JokerZzZ*/

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More