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

Find Index of least significant bit set in an Integer. ex. int value is say 10001000 results should be 4.

1 Answers  


#include<std.h> int main() { char *str[]={"Frogs","Do","Not","Die","They","Croak!"}; printf("%d %d\n",sizeof(str),strlen(str)); ...return 0; } what will the output of the above program?

6 Answers  


Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

0 Answers   Convergys,


Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

0 Answers   GrapeCity,


Why can't I perform arithmetic on a void* pointer?

0 Answers  


Where define directive used?

0 Answers  


How can I open a file so that other programs can update it at the same time?

0 Answers  


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

0 Answers  


SIR PLS TELL ME THE CODE IN C LANGUAGE TO PRINT THE FOLLOWING SERIES 1 1 2 1 1 2 3 2 1 1 2 3 4 3 2 1 1 2 3 2 1 1 2 1 1

4 Answers  


to find the program of matrix multiplication using arrays

6 Answers   Bhel,


Function to find the given number is a power of 2 or not?

20 Answers   Motorola, nvidia,


What are the differences between new and malloc in C?

0 Answers   Amazon,


Categories