Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is the purpose of the code, and is there any problem
with it.

unsigned int v[10];
unsigned int i = 0;
while (i < 10)
v[i] = i++;

Answers were Sorted based on User's Feedback



what is the purpose of the code, and is there any problem with it. unsigned int v[10]; unsign..

Answer / goutham

trying to fill the array v[i] with post increment of i,
there is no problem;
output is
v[0]=0;
v[1]=1
v[2]=2
v[3]=3
v[4]=4
v[5]=5
v[6]=6
v[7]=7
v[8]=8
v[9]=9

Is This Answer Correct ?    7 Yes 2 No

what is the purpose of the code, and is there any problem with it. unsigned int v[10]; unsign..

Answer / arka bandyopadhyay

Basically it's a tricky question and the values of v[i] cannot be predicted as there is "i++" which means 'use than change'
that is error associated with the program so using ++i will give us the correct result.

Is This Answer Correct ?    4 Yes 3 No

Post New Answer

More C Interview Questions

2.main { int x,j,k; j=k=6;x=2; x=j*k; printf("%d", x);

9 Answers   HCL, Tech Mahindra,


void main() { int i=5; printf("%d",i+++++i); }

17 Answers   ME,


What is meant by type casting?

0 Answers  


Write a program to print ASCII code for a given digit.

0 Answers   EXL, HCL,


Write a program to give following output..... ********* **** **** *** *** ** ** * * ** ** *** *** **** **** *********

4 Answers  


What are all different types of pointers in c?

0 Answers  


Explain how can I make sure that my program is the only one accessing a file?

0 Answers  


WRITE A C PROGRAM TO FIND SECOND BIGGEST VALUE FROM THE GIVEN VALUES

1 Answers  


Write a c program using for loop to print typical pattern if number of rows is entered by keyboard. ABCBA AB BA A A

1 Answers  


Differentiate between a structure and a union.

0 Answers   Zensar,


Given an unsigned integer, find if the number is power of 2?

5 Answers  


Explain what is the concatenation operator?

0 Answers  


Categories