Toggle navigation
Images.Elk.pl
Podstawy Programowania
15 SYMBOLI '-'
#include
#include
#include
using namespace std;
int main()
{
int i=0,t;
cout<<"petla while\n";
while(i<=14)
{
cout<<"-";
i++;
}
cout<<"\npetla for\n";
for(t=0;t<=14;t++)
{
cout<<"-";
}
system("PAUSE");
return EXIT_SUCCESS;
}
LICZBY PARZYSTE
#include
#include
#include
using namespace std;
int main()
{
int o=101,u;
cout<<"petla while\n";
while(o<=101 && o>=0 && o--)
{
cout<
o--;
}
cout<<"\npetla for\n";
for(u=100;u>=0;u--)
{
cout<
u--;
}
system("PAUSE");
return EXIT_SUCCESS;
}
LICZBY PODZIELNE PRZEZ 7
#include
#include
#include
using namespace std;
int main()
{
int i=70,w=0,t=70,a;
cout<<"petla while"<
while(w<10)
{
cout<
i=i+7;
w++;
}
cout<<"\npetla for"<
for(a=0;a<10;a++)
{
cout<
t=t+7;
}
system("PAUSE");
return EXIT_SUCCESS;
}
LICZBY MALEJĄCE
#include
#include
#include
using namespace std;
int main()
{
int a;
cout<<"Podaj liczbe"<
cin>>a;
int b=a;
cout<<"petla for"<
for( ;a>=0;a--)
{
cout<
}
cout<<"\npetla while"<
while(b>=0)
{
cout<
b--;
}
system("PAUSE");
return EXIT_SUCCESS;
}
SUMA
#include
#include
#include
using namespace std;
int main()
{
int b,s=0,k,j;
cout<<"petla while"<
while (b!=2)
{
cout<<"podaj liczbe"<
cin>>b;
s=s+b;
}
cout<<"wynik="<
cout<<"petla for"<
for(k=0;j!=2; )
{
cout<<"podaj liczbe"<
cin>>j;
k=k+j;
}
cout<<"wynik="<
system("PAUSE");
return EXIT_SUCCESS;
}
Wyszukiwarka
Podobne podstrony:
zestawy cwiczen przygotowane na podstawie programu Mistrz Klawia 6
Podstawy Programowania Wersja Rozszerzona
Visual C 6 0 Podstawy programowania
matlab podstawy programowania
JP SS 2 algorytmy i podstawy programowania
Podstawy programowania II 2
podstawy programowania 5
Podstawy programowania 11 2013
podstawa programowa
podstawa programowa
Podstawy Programowania
Delphi podstawy programowania rejestr systemowy
wychowanie fizyczne w nowej podstawie programowej
ćw 05 podstawy programowania
zestawy cwiczen przygotowane na podstawie programu Mistrz Klawia 8
[C ]Rataj Podstawy programowania obiektowego
Podstawy programowania programy 17 12 2013
podstawa programowa z plastyki nowa
więcej podobnych podstron