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
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 |
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 |
How many types of operator or there in c?
What will the preprocessor do for a program?
What is wrong with this program statement?
multiple of 9 without useing +,* oprator
What are run-time errors?
swap 2 numbers without using third variable?
What is default value of global variable in c?
In the following code segment what will be the result of the function, value of x , value of y { unsigned int x=-1; int y; y = ~0; if(x == y) printf("same"); else printf("not same"); } a) same, MAXINT, -1 b) not same, MAXINT, -MAXINT c) same , MAXUNIT, -1 d) same, MAXUNIT, MAXUNIT e) not same, MAXINT, MAXUNIT
what is the format specifier for printing a pointer value?
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
write a program in c to find out the sum of digits of a number.but here is a condition that compiler sums the value from left to right....not right to left..
Which built-in library function can be used to match a patter from the string?