Question

Write the output of the following C codes, with proper justification for each. 
i) main()
{
int i = 5, j = 6, k = 7;
printf("%d", i++ - ++j + ++k);
}
ii) main()
{
char day[10] = "SUNDAY";
day[0] = 77;
day[1] = 79;
printf("%s", day);
}
iii) main()
{
int i = 3;
while(i--)
{
int i = 1;
printf("%d ", i);
i++;
}
}
iv) int f(int n)
{
if(n < 1)
return n;
else
return n*n + f(n-1);
}
main()
{
printf("%d", f(5));
}
v) struct employee
{
char name[20];
int id;
long salary;
}emp = {"Piyush", 1, 50000};
main()
{
printf("Name = %s ", emp.name);
printf("ID =%d", emp.id);
printf("Salary = %d", emp.salary);
}

19 Mar 2023
Answer :
Word Count : 445

i) The output of this C code will be -8. The expression i++ - ++j + ++k is evaluated from left to right. First, i++ returns the current value of i (which is 5) and then increments i. Next, ++j increments j and returns the new value (which is 7). Finally, ++k increments k and returns the new value (which is 8). Substituting these values into the expression, we get 5 - 7 + 8, which is equal to -8.

ii) The output of this C code will be _______ _____ ___ __________ ______ ___ ________ _______.
_________ ______ ____ _______ ______ __________ ____ _________ _____ ____ ________ ___.
________ ______ ____ ________ _____ _____ _______ __________.
____ _______ ___ ________ _______ _____ _______ ___ ___ ____ ____ ____.
_______ _______ _______ __________ _____ _________ _______ __________ __________ _________ __________ ____.
_______ ________ _________ ______ ___ __________ ______ ___ ____.
_______ _______ ____ _________ _________ ________.
___ ________ ________ ______ ____.
____ _____ _______ ____ ______ ______.
__________ ________ __________ ___ ______ ____ ____ _______.
________ __________ _________ _______ ________ ______ _____.
___ _____ _________ ______ ___ __________ ____ ____ ____ ___ _________ _____.
______ _______ ___ _______ ______ ____ ____ ________ ___.
_____ __________ _____ __________ ___ _________ ___ _____ _____ ______ _________.
________ __________ _____ _______ ___ _________ _____ _______.
____ ____ ___ ________ ____ __________ __________ _____ ______ __________ ______.
____ ________ __________ _____ _________ _____ ________ ______ __________ ____.
__________ ____ __________ _____ _______ ______ _____.
________ ________ _______ __________ _______ _________ ___ ____ ______ __________ _________.
________ ________ __________ ______ __________.
__________ _______ _________ ___ ___ ___.
_________ ___ ____ ______ ___ _______ _____ ___ _____.
________ _________ ____ ________ ______ ___ ____ _______ ________ __________.
____ _______ ________ ___ _______ _____ ____ __________.
________ _____ ____ _____ ________ _______ ____ ____ ________ ____ __________ __________.
_____ ___ ______ _______ _________.
________ _______ __________ ______ ______ ___.
______ _______ ___ ________ ____ ___.
_______ _______ ___ ___ ___.
___ _________ _____ ____ __________ _______ ______ ______ ____.
__________ _____ _______ ________ ______ ______ __________ ______ ________ _________ ____ ______.
_______ __________ _____ _____ ___.
_______ ___ ____ ______ ___ ______ ____ ______ __________ ______ _________.
________ _______ ______ _____ ______ _______ __________ ____ ________ ______ __________.
__________ ______ __________ __________ _______ _________ ________ _________ ____.
_________ __________ _______ ____ _________ ________ ___ ___ __________.
____ ___ ________ __________ ________ ________ __________ ___ _______ ______ ________.
_________ __________ __________ ____ ______ __________ ________ _______ ____ ____.
___ ____ ___ _______ ______ ___ _____ _________.
__________ _____ _______ ________ ______ _____ __________ _____ ______ ___ _______ _____.
_____ ________ ________ ____ __________.
Get Full Answer on WhatsApp

IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance Write the output of the following C codes, with proper justification f
🟢
WhatsApp Chat Fast live messaging
Email Us Business enquiries & support