“Hello world!!!”
ok that’s I just say hello to world not to real
world , but to progamer world :D. Yes that is my first program using c++ my first language program wich can show what
letter we typed in monitor.
That is very simple , we just have typed short program in Microsoft
visual c++ bu t now, I have more difficult program day to day. Until now we can make program
for calculate temperature convertion, calculate
average points of students in a class, and other difficult program until now
ican write progam like this :
/* File program : jml2array.c */
#include <stdio.h>
int jml2array(int [][5], int);
main()
{
int jml;
int bil[][5] = {
{1, 2, 35, 7,
10},
{6, 7, 4, 1, 0}
};
jml = jml2array(bil, 2);
printf("Hasil penjumlahan 2 array tsb adalah =
%d\n",
jml);
}
int jml2array(int data[][5], int jmlbrs)
{
int total = 0,
kolom, baris;
for(baris = 0; baris < jmlbrs; baris++ )
for(kolom = 0;
kolom < 5; kolom++ )
total +=
data[baris][kolom];
return total;
}
Yes that’s all thank you for reading, have a nice day!
No comments:
Post a Comment