Tuesday 23 February 2016

C = TUGAS KULIAH PEMROGRAMAN BAHASA C

Nah jadi ceritanya soalnya itu seperti ini kawang-kawang
Untuk solusinya berikut source code untuk masing-masing soal dengan menggunakan bahasa C++, aplikasi borland C. Jadi source codenya opensource yah jadi bebas copy paste.

1)
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
#include <math.h>

void main()
{
int a,b,c,d,e;
int f[11];
b=0;c=0;d=0;
cout<<"CACAHAN"<<"\t\tJUMLAH";
for (a=0;a<10;a++)
{
c=c+1;
b=b+2;
f[c]=b;
cout<<"\n"<<f[c]<<"\t\t\t";
d=d+f[c];
cout<<d<<"\t";
}

cout<<"\n\n\n\t\t\tCreated by. AhmadRuliAL"<<"\n\t\t\t-----------------------";
getch();
}

Hasilnya akan seperti berikut.

2)

#include <stdio.h>
#include <conio.h>
#include <iostream.h>
#include <math.h>

void main()
{
int a,b,c,d,e,f;
int g[10],h[10];
b=-1;  c=0;
for (a=0;a<5;a++)
{
b=b+2;
e=0;
c=c+1;
g[c]=b;
h[c]=1;
for(d=1;d<=c;d++)
{
e=e+1;
cout<<g[d];
h[c]=1*h[c]*g[d];
if (d!=c)
{
cout<<"x";
}

}

cout<<"\t\t\t="<<h[c];
cout<<"\n";
}
cout<<"\n\n\n\t\t\tCreated by. AhmadRuliAL"<<"\n\t\t\t-----------------------";
getch();
}

Hasilnya akan terlihat seperti berikut.


3)

#include <stdio.h>
#include <conio.h>
#include <iostream.h>
#include <math.h>

void main()
{
float a,c,d,e;
float b=0.02;
int f,g;
a=1000000;
cout<<"Tabungan="<<a;
cout<<"\nbunga="<<b;
for (f=1;f<=10;f++)
{
cout<<"\n"<<f;
c=a*b;
a=c+a;
g=a;
cout<<"\t"<<g;
}
cout<<"\n\n\n\t\t\tCreated by. AhmadRuliAL"<<"\n\t\t\t-----------------------";

getch();
}

Hasilnya akan terlihat seperti berikut.

Ok Terimakasih Semoga Membantu.


No comments:

Post a Comment