Social Sciences, asked by itslarryh, 1 month ago

Write a C# program that will display the following pattern: 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1

Answers

Answered by lohitjinaga
0

Answer:

#include <iostream>

using namespace std;

int main(){

int i=1,j=10;

for(int k=0;k<10;k++){

cout<<j<<" "<<i<<" ";

j--;i++;

}

cout<<"\n";

return 0;

}

#include &lt;iostream&gt; </p><p></p><p>using namespace std; </p><p></p><p>int main(){ </p><p></p><p>int i=1,j=10; </p><p></p><p>for(int k=0;k&lt;10;k++){ </p><p></p><p>cout&lt;&lt;j&lt;&lt;" "&lt;&lt;i&lt;&lt;" "; </p><p></p><p>j--;i++; </p><p></p><p>} </p><p></p><p>cout&lt;&lt;"\n"; </p><p></p><p>return 0; </p><p></p><p>} </p><p></p><p>

Similar questions