#include <iostream>
#include <string>
using namespace std;
float f1(float f)
{
cout<<f<<" ";
return f+4;
}
float f2(float f)
{
return f1(f1(f)+f);
}
int main()
{
for(int i=1;i<8;i+=2)
cout<<f1(i)<<" ";
}
Çıktı :
1 5 3 7 5 9 7 11
#include <iostream>
#include <string>
using namespace std;
int main()
{
int i, j ;
for (i = 1 ; i < 5 ; i++)
{
for (j = 0 ; j <= 5 ; j++)
{
if ( (i + j) % 2 == 0 ) {
cout <<"X";
}
else {
cout<<"Y";
}
}
cout<< endl;
}
}
Çıktı :
YXYXYX
XYXYXY
YXYXYX
XYXYXY
Bu yazı yorumlara kapalı.