Call Support +91-85588-96644
TCYonline

Login

Sign Up

Please enter a Username or Email ID
Please enter a password
Keep me logged in
Please enter your name
Please enter your mobile number
You can't leave Captcha Code empty
By submitting this form, you agree to the Terms & Privacy Policy.
OR

Sign Up via Facebook

Sign Up via Google

Sign Up via Twitter

Download Software
Tests given

Download TCY App

App Image

What will be the output of following code?
The value of 'n` is `3` and the value of 'm' is `0`.

for(i=1;i<=n;i++)
{
m=i+m;
printf("%d %d ",i,m);
}

 
1 1
2 2
3 3
1 1
2 3
3 6
112336
1 1 2 3 3 6

Reply


Please type your answer before submitting.
Submit

C is correct along to its iterations and there is no any new line character like '\n' so after each iteration sequence does not print on next line ,so a and b option are incorrect and also there is no any tab character for space in each character like '\t' so option d is incorrect.

In this case d is right. bcoz there is no "n" used in this program