ماذا يطبع الكود السابق ( سؤال مشابه للامتحان )
Anonymous Quiz
48%
لا يطبع
14%
يترك سطرين فارغين في الشاشة السوداء
26%
يترك سطر فارغ في الشاشة السوداء
11%
يطبع 2
1%
يطبع 3
#include <iostream>
using namespace std;
void main()
{
for (int x = 100; x <= 1; ++x)
cout << x << endl;
}
using namespace std;
void main()
{
for (int x = 100; x <= 1; ++x)
cout << x << endl;
}
👍2
🫡2
#include <iostream>
using namespace std;
void main()
{
for (int x = 1; x <= 100; ++x)
cout << x << endl;
}
using namespace std;
void main()
{
for (int x = 1; x <= 100; ++x)
cout << x << endl;
}
🫡1
في الكود السابق كيف يمكننا تغيير العنصر الأول من هذه المصفوفة إلى 16؟
Anonymous Quiz
21%
A.numbers[1] = 16;
59%
B.numbers[0] = 16;
12%
C.numbers[2] = 16;
8%
D.numbers[3] = 16;
❤1
🫡2
👍2❤1
❤2👎1
👍5
#include <iostream>
using namespace std;
int main() {
string text1 = "C++";
string text2 = "Python";
cout << "Before Swapping:" << endl;
cout << "text1 = " << text1 << endl;
cout << "text2 = " << text2 << endl;
text1.swap(text2);
cout << "\nAfter Swapping:" << endl;
cout << "text1 = " << text1 << endl;
cout << "text2 = " << text2;
return 0;
}
using namespace std;
int main() {
string text1 = "C++";
string text2 = "Python";
cout << "Before Swapping:" << endl;
cout << "text1 = " << text1 << endl;
cout << "text2 = " << text2 << endl;
text1.swap(text2);
cout << "\nAfter Swapping:" << endl;
cout << "text1 = " << text1 << endl;
cout << "text2 = " << text2;
return 0;
}
👍1