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 + ______ ______ ___ ____ _________ ________ ________ __________.
____ ________ ___ ________ _____ ______ _______ __________.
______ _____ ___ ___ _______ ________ __________ _______ ___ ______ ________.
_________ _______ ___ ____ __________ ________ __________ ______ ________.
_________ __________ __________ ____ __________ _________ _____ _______ ___ ______.
________ __________ ________ __________ ____ ________ ________.
___ _________ ____ _____ _________ _________ ____.
____ _________ ____ ____ ________ ___ ____ __________ ________ ____ ________ ________.
___ ___ __________ ________ _______ _________ _____ __________ ____ _______ ___.
_____ _______ ___ ______ ___ ______.
____ ________ _______ _____ ______ _________ ___ ___ _______.
_____ _______ ________ ____ _________ _________.
__________ _______ ___ _______ _____ _______ ________.
__________ ____ _______ ___ ___ ___ _______ ______.
____ _____ _______ ______ _______ _______ _________ ____ _________ ___.
___ ___ _______ ______ _________ _____ ______ _______ ________ _______ _____ _________.
_______ ___ ____ _________ _______ ______ _________ __________ _________ ____.
____ ________ __________ ________ ____ _______ ___ ____ _______ ____ __________.
___ _____ ____ ____ _____.
_____ ___ __________ ___ ________ _______ _________.
_____ _____ _____ ____ _________ ______ ____ _______ ____ __________ ____ _________.
___ ____ _______ ___ _____ ________ ____ ___ _______.
____ ____ _______ ______ ______ _____ ____.
_______ _______ _________ _____ _______ __________ _______ ___ ___ _____ _____ ________.
____ _______ __________ ____ ________ ___ ______ _________ ___.
________ _______ _______ ___ __________ ____ __________ __________ ___ ____ ___.
_____ ________ __________ __________ _______ ________ __________ ____ ____ _________.
____ ______ _____ __________ ______ _____ ___ ____ __________ __________.
_____ _________ ___ ________ ___ ______ _______ ___ ______.
______ ________ ____ ________ _____ _________ _________ __________.
_____ _________ __________ __________ __________ ____ ________ ____ __________ _______ ___.
________ ___ ___ ______ ______ _________.
_________ __________ ________ ____ _____ _______ __________ ______ ______ _____ ___ ________.
________ __________ ____ _________ ___ ___ _________ ___ _________ ___.
______ _____ ________ ________ _________ ______.
__________ ___ ___ __________ ________ _____ ________ ____ ____.
_______ ___ ______ ______ ________ ____ _______ ______ ___.
_____ ___ _____ ______ ____ ________ _________ _______ _____.
_______ _______ ______ __________ ______ _____ ____ ______ _________ _____ _______.
________ _____ ___ ___ _______ _____.
_________ ____ ______ __________ ___ ____ _____ _________ ____ _________.
______.
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
→