What is the output from the following C program include main

What is the output from the following C++ program? #include main() {int i, j = 5; for(i = 0; i

Solution

Answer:

5)A (5555)

explanation:

#include <iostream>

using namespace std;

int main()

{
   // your code goes here
   int i,j=5;
  
   for(i=0;i<=j;i++)
   {
   cout<<j<<\"\";
   }
}

output:

5555

6) D(infinte loop)

explanation:

#include <iostream>

using namespace std;

int main()

{
   // your code goes here
   int i=0,j=3;
   do
   //for(i=0;i<=j;i++)
   {
   cout<<i+j<<\"\";
   }while(i+j<4);
}

output:

33333333333333333333333333333333333333333333333333333333333333333333333

 What is the output from the following C++ program? #include main() {int i, j = 5; for(i = 0; iSolutionAnswer: 5)A (5555) explanation: #include <iostream>

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site