# include <conio>
# include <iostream>
main ()
{
int A [100];
int max, limit, Number, select;
court <<"Enter limit:";
cin>> limit;
Number = 0;
for (int x = 0; x <limit; x + +) {
court <<"\ n \ nEnter data" <<(x +1) <<"=";
cin>> A [x];
Number = Number + A [x];}
court <<"\ n \ njumlah =" <<Number;
for (int y = 0; y <limit; y + +) {
if (A [y]> max) {
max = A [y];
}
}
court <<"\ nmax =" <<max;
getch ();}
Thursday, June 30, 2011
Behind the words:
# include <stdio.h>
# include <conio.h>
# include <string.h>
main ()
{
char o [20];
textcolor (8);
printf ("Enter a word:");
gets (o);
strrev (o);
cprintf ("If reversed into:% s", o);
getch ();
}
# include <conio.h>
# include <string.h>
main ()
{
char o [20];
textcolor (8);
printf ("Enter a word:");
gets (o);
strrev (o);
cprintf ("If reversed into:% s", o);
getch ();
}
Friday, June 24, 2011
The number of odd
The number of odd
# include <iostream>
# include <conio.h>
int i, n, total;
void input ()
{
court <<"Enter the odd / even =";
cin>> n;
court <<endl;
}
void process ()
{
for (i = 1; i <n; i = i +2)
{
court <<"" <<i <<"";
total = total + i;
}
court <<"\ n The sum of all of the odd numbers less than" <<n <<"is" <<total <<"";
}
main ()
{
input ();
process ();
getch ();
}.........
# include <iostream>
# include <conio.h>
int i, n, total;
void input ()
{
court <<"Enter the odd / even =";
cin>> n;
court <<endl;
}
void process ()
{
for (i = 1; i <n; i = i +2)
{
court <<"" <<i <<"";
total = total + i;
}
court <<"\ n The sum of all of the odd numbers less than" <<n <<"is" <<total <<"";
}
main ()
{
input ();
process ();
getch ();
}.........
PROGRAM FOR CALCULATING AREA AND TOUR RECTANGLE
# include <iostream>
# include <conio>
main ()
{
int p, l, for example, area, circumference;
court <<"\ n \ n ****************************************** **********"
"\ n PROGRAM FOR CALCULATING AREA AND TOUR RECTANGLE"
"\ n *********************************************** *****"
"\ n \ ncontoh length = 25 \ n" "example width = 15 \ n"
"the breadth = 375 \ n" "while the circumference = 80 \ n \ n" <<sample;
court <<"\ nEnter length =";
cin>> p;
court <<"enter width =";
cin>> l;
area = p * l;
court <<"the area of the rectangle is a =" <<area;
circumference = 2 * (p + l);
court <<"\ nsedangkan circumference is =" <<circumference;
getch ();
}
# include <conio>
main ()
{
int p, l, for example, area, circumference;
court <<"\ n \ n ****************************************** **********"
"\ n PROGRAM FOR CALCULATING AREA AND TOUR RECTANGLE"
"\ n *********************************************** *****"
"\ n \ ncontoh length = 25 \ n" "example width = 15 \ n"
"the breadth = 375 \ n" "while the circumference = 80 \ n \ n" <<sample;
court <<"\ nEnter length =";
cin>> p;
court <<"enter width =";
cin>> l;
area = p * l;
court <<"the area of the rectangle is a =" <<area;
circumference = 2 * (p + l);
court <<"\ nsedangkan circumference is =" <<circumference;
getch ();
}
Tuesday, May 3, 2011
Program Array3
Program Array3;
Uses Wincrt;
Var x: array [1..100] of integer;
n,i,max,min,tot,pos:integer;
rt,sdt,sd,md:real;
Begin
Writeln('Program Array');
Writeln('=============');
Writeln;
Write('Masukkan Jumlah Data (Data harus Urut): ');readln(n);
Writeln;
For i:= 1 to n do
Readln(x[i]);
Writeln;
Write('Data Yang Telah Dimasukkan: ');
Uses Wincrt;
Var x: array [1..100] of integer;
n,i,max,min,tot,pos:integer;
rt,sdt,sd,md:real;
Begin
Writeln('Program Array');
Writeln('=============');
Writeln;
Write('Masukkan Jumlah Data (Data harus Urut): ');readln(n);
Writeln;
For i:= 1 to n do
Readln(x[i]);
Writeln;
Write('Data Yang Telah Dimasukkan: ');
Program Array2
Program Array2;
Uses Wincrt;
Var x : array [1..100] of integer;
n,i,max,min : integer;
Begin
Writeln('Program Array');
Writeln('=============');
Writeln;
Write('Masukkan Jumlah Data: ');readln(n);
Writeln;Writeln('Data Harus Urut');
For i:= 1 to n do
Readln(x[i]);
Writeln;
Write('Data Yang Telah Dimasukkan: ');
Uses Wincrt;
Var x : array [1..100] of integer;
n,i,max,min : integer;
Begin
Writeln('Program Array');
Writeln('=============');
Writeln;
Write('Masukkan Jumlah Data: ');readln(n);
Writeln;Writeln('Data Harus Urut');
For i:= 1 to n do
Readln(x[i]);
Writeln;
Write('Data Yang Telah Dimasukkan: ');
Program Array
Uses Wincrt;
Var x : array [1..100] of integer;
n,i :integer;
Begin
Writeln('Program Array');
Writeln('=============');
Writeln;
Write('Masukkan Jumlah Data: ');readln(n);
Writeln;
For i:= 1 to n do
Readln(x[i]);
Writeln;
Write('Data Yang Telah Dimasukkan: ');
For i:= 1 to n do
Write(x[i],' ');
End.
Var x : array [1..100] of integer;
n,i :integer;
Begin
Writeln('Program Array');
Writeln('=============');
Writeln;
Write('Masukkan Jumlah Data: ');readln(n);
Writeln;
For i:= 1 to n do
Readln(x[i]);
Writeln;
Write('Data Yang Telah Dimasukkan: ');
For i:= 1 to n do
Write(x[i],' ');
End.
Subscribe to:
Posts (Atom)