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 = 3; for (i = 0; i

Solution

Ans : 3 3 3 3 .   

#include<iostream.h>

int main(){
int i,j=3;
for(i=0;i<=j;i++)
cout<<j<<\" \";
return 0;
}

It prints 3 as value of j is 3 and it prints 3 four times as it starts from i=0 till i==j i.e i=j=3.

 What is the output from the following C++ program? #include main() {int i, j = 3; for (i = 0; iSolutionAns : 3 3 3 3 . #include<iostream.h> int main(){ i

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site