English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Supposed to use two for loops.. dont use any fancy ****.

Write a program that uses NESTED LOOPS to produce the following output :

A1B1B2B3A2B1B2B3

2006-11-07 11:11:14 · 3 answers · asked by jdk7212000 1 in Computers & Internet Programming & Design

This is C++.. not C. Theres NO SUCH THING AS PRINT.F

2006-11-07 12:07:54 · update #1

3 answers

You can use printf with C++ if you want, but since you complain...
for (i = 1; i < 3; i++){
 cout << "A" << i;
for (j = 1; j < 4; j++){
cout << "B" << j;
}
}

2006-11-07 13:32:17 · answer #1 · answered by sterno73 3 · 1 1

Why do no longer you in elementary terms upload a non everlasting variable? ok, merely thinknig approximately it, this works: (this could all be pseudo code by way of fact i won't be able to remember C) Variables would be called var1 and var2. var1 = var1 + var2 var 2 = var1 - var2 var1 = var2 - var1 each step being carried out after the previous one. wish it enables.

2016-12-14 03:20:57 · answer #2 · answered by lacy 4 · 0 0

int i,,j;

for(i=1; i<3; i++)
{
printf("A");
for(j=1; j<4; j++)
{
printf("B%x", j);
}
}

2006-11-07 11:22:10 · answer #3 · answered by sdc_99 5 · 1 1

fedest.com, questions and answers