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

program to convert a integer to string in c language'

0 Answers  


What is the difference between null pointer and wild pointer?

0 Answers  


Define C in your own Language.

0 Answers   Motorola,


I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.

0 Answers   Oracle,


What are local static variables? How can you use them?

0 Answers  


main() { static int ivar=5; printf("%d",ivar--); if(ivar) main(); }

3 Answers   CSC,


Write a program to find the given number is odd or even without using any loops(if,for,do,while)

4 Answers   CNC, Gokul,


What does sizeof function do?

0 Answers  


Which is an example of a structural homology?

0 Answers  


Write a function that accepts a sentence as a parameter, and returns the same with each of its words reversed. The returned sentence should have 1 blank space between each pair of words. Demonstrate the usage of this function from a main program. Example: Parameter: “jack and jill went up a hill” Return Value: “kcaj dna llij tnew pu a llih”

5 Answers   Mind Tree,


why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???

0 Answers  


How can I call fortran?

0 Answers  


Categories