Ana sayfa
/
Teknoloji
/
Examine the C++ source code given in the following two quest exact output that would be displayed when the program 1 sinclude siostre am 2 using namespac e std; 3 main(void) 4P ( 5 int i,j, result; 6 for (int is10;1 )5ị.i) 8 for (int julijes2;++j) 11 cout ke"cres ult; resultai'j; 12 13 couts "In": 14 15 return 0 ; 16 3.2 (10 pts) Hincludeciost ream> a using nam unspa e std i 3 int ain() 5 int x 6 for(x lixe -4; xee) for(sall s(ad-x) sti) coutce" 10 for (yel; ycox; you) 12 cout(<s) 14 cout<<endl; ) 16 17 return 0; 3.3 (10 pts) sinclude ciostreas) 2 tinclude <string) 3 using namespace std; 58 int main() 6 7 int nuess; sẽ switch (nummur-1) case 0: 10 cout<<"Cyprusin"; u case 1: 12 couts "In tern atio nallo"; 13 breaks 14 default: 15 coutce"Universityln" 16 ) 17 string alpha=(num) mun)","North":"Cyprus"}

Soru

Examine the C++ source code given in the following two quest
exact output that would be displayed when the program
1
sinclude siostre am
2
using namespac e std;
3
main(void)
4P (
5
int i,j, result;
6
for (int is10;1 )5ị.i)
8
for (int julijes2;++j)
11
cout ke"cres ult;
resultai'j;
12
13
couts "In":
14
15
return 0 ;
16
3.2 (10 pts)
Hincludeciost ream>
a using nam unspa e std i
3 int ain()
5	int x
6	for(x lixe -4; xee)
for(sall s(ad-x) sti)
coutce"
10	for (yel; ycox; you)
12	cout(<s)
14	cout<<endl;
)
16
17	return 0;
3.3 (10 pts)
sinclude ciostreas)
2 tinclude <string)
3 using namespace std;
58 int main()
6
7	int nuess;
sẽ switch (nummur-1)
case 0:
10
cout<<"Cyprusin";
u	case 1:
12
couts "In tern atio nallo";
13	breaks
14	default:
15
coutce"Universityln"
16	)
17 string alpha=(num) mun)","North":"Cyprus"}

Examine the C++ source code given in the following two quest exact output that would be displayed when the program 1 sinclude siostre am 2 using namespac e std; 3 main(void) 4P ( 5 int i,j, result; 6 for (int is10;1 )5ị.i) 8 for (int julijes2;++j) 11 cout ke"cres ult; resultai'j; 12 13 couts "In": 14 15 return 0 ; 16 3.2 (10 pts) Hincludeciost ream> a using nam unspa e std i 3 int ain() 5 int x 6 for(x lixe -4; xee) for(sall s(ad-x) sti) coutce" 10 for (yel; ycox; you) 12 cout(<s) 14 cout<<endl; ) 16 17 return 0; 3.3 (10 pts) sinclude ciostreas) 2 tinclude <string) 3 using namespace std; 58 int main() 6 7 int nuess; sẽ switch (nummur-1) case 0: 10 cout<<"Cyprusin"; u case 1: 12 couts "In tern atio nallo"; 13 breaks 14 default: 15 coutce"Universityln" 16 ) 17 string alpha=(num) mun)","North":"Cyprus"}

Çözüm

4.1198 Voting
avatar
Mina
Gelişmiş · 1 yıl öğretmeni
Uzman doğrulaması

Cevap

It seems like there are some errors and typos in the provided C++ source code. However, I'll do my best to interpret and provide the output for each program.<br /><br />### Program 1:<br />```cpp<br />#include <iostream><br />using namespace std;<br /><br />int main(void)<br />{<br /> int i, j, result;<br /> for (int i = 0; i < 10; i++)<br /> {<br /> for (int j = 0; ++j < 10;)<br /> {<br /> cout << "i: " << i << " j: " << j << " result: " << i * j << endl;<br /> result = i * j;<br /> }<br /> }<br /> cout << "In: " << endl;<br /> return 0;<br />}<br />```<br /><br />### Program 2:<br />```cpp<br />#include <iostream><br />using namespace std;<br /><br />int main()<br />{<br /> int x;<br /> for (x = -4; x < 0; x++)<br /> {<br /> for (int s = (x - 1); s < 0; s++)<br /> {<br /> cout << "x: " << x << " s: " << s << endl;<br /> }<br /> }<br /> for (int y = 0; y < 0; y++)<br /> {<br /> cout << "y: " << y << endl;<br /> }<br /> cout << endl;<br /> return 0;<br />}<br />```<br /><br />### Program 3:<br />```cpp<br />#include <iostream><br />#include <string><br />using namespace std;<br /><br />int main()<br />{<br /> int nummer;<br /> cout << "Enter a number: ";<br /> cin >> nummer;<br /> switch (nummer - 1)<br /> {<br /> case 0:<br /> cout << "Cyprusin" << endl;<br /> break;<br /> case 1:<br /> cout << "International" << endl;<br /> break;<br /> default:<br /> cout << "University" << endl;<br /> }<br /> return 0;<br />}<br />```<br /><br />### Output Analysis:<br /><br />#### Program 1:<br />- **Output**: This program will output a series of values for `i`, `j`, and `result` for each iteration of the loops. The output will be:<br /> ```<br /> i: 0 j: 0 result: 0<br /> i: 0 j: 1 result: 0<br /> i: 0 j: 2 result: 0<br /> i: 0 j: 3 result: 0<br /> i: 0 j: 4 result: 0<br /> i: 0 j: 5 result: 0<br /> i: 0 j: 6 result: 0<br /> i: 0 j: 7 result: 0<br /> i: 0 j: 8 result: 0<br /> i: 0 j: 9 result: 0<br /> i: 1 j: 0 result: 0<br /> i: 1 j: 1 result: 1<br /> i: 1 j: 2 result: 2<br /> i: 1 j: 3 result: 3<br /> i: 1 j: 4 result: 4<br /> i: 1 j: 5 result: 5<br /> i: 1 j: 6 result: 6<br /> i: 1 j: 7 result: 7<br /> i: 1 j: 8 result: 8<br /> i: 1 j: 9 result: 9<br /> i: 2 j: 0 result: 0<br /> i: 2 j: 1 result: 2<br /> i: 2 j: 2 result: 4<br /> i: 2 j: 3 result: 6<br /> i: 2 j: 4 result: 8<br /> i: 2 j: 5 result: 10<br /> i: 2 j: 6 result: 12<br /> i: 2 j: 7 result: 14<br /> i: 2 j: 8 result: 16<br /> i: 2 j: 9 result: 18<br /> i: 3 j: 0 result: 0<br /> i: 3 j: 1 result: 3<br /> i: 3 j: 2 result: 6<br /> i: 3 j: 3 result: 9<br /> i: 3 j: 4 result: 12<br /> i: 3 j: 5 result: 15<br /> i: 3 j: 6 result: 18<br /> i: 3 j: 7 result: 21<br /> i: 3 j: 8 result: 24<br /> i: 3 j: 9 result: 27<br /> i: 4 j: 0 result: 0<br /> i: 4
Derecelendirmek için tıklayın: