The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
14 views

What will be the output of the following C program? If you think it will give a runtime error, you need to mention it. In either case, your answer must include proper justifications without which no credit will be given.

#include<stdio.h>
main()
{
unsigned char i, j, a[]={1, 2, 3, 4, 5};
int n;
i=j=n=5;
while(i-- !=0) n+=a[i];
while j++ !=0) n+=2;
printf("i=%d, j=%d, n=%d\n", i, j, n);
while(j-- !=0) a[0]+=n;
printf("j=%d, a[0]=%d\n", j, a[0]);
}
asked in Others by Veteran (112k points) | 14 views

Please log in or register to answer this question.

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

44,316 questions
49,814 answers
164,569 comments
65,868 users