what will be the output of this program?
void main()
{
int a[]={5,10,15};
int i=0,num;
num=a[++i] + ++i +(++i);
printf("%d",num);
}
Answer Posted / abc
initially i=0;
num=a[++i]+ ++i + ++i;
num=a[1]+2+3
num=10+2+3=15
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
Explain pointers in c programming?
What is the difference between void main and main in c?
What is %lu in c?
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
Can a variable be both constant and volatile?
How to find a missed value, if you want to store 100 values in a 99 sized array?
What is the c value paradox and how is it explained?
Explain can you assign a different address to an array tag?
Why is c fast?
When do we get logical errors?
How to declare pointer variables?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
Why we use int main and void main?
You have given 2 array. You need to find whether they will
create the same BST or not.
For example:
Array1:10 5 20 15 30
Array2:10 20 15 30 5
Result: True
Array1:10 5 20 15 30
Array2:10 15 20 30 5
Result: False
One Approach is Pretty Clear by creating BST O(nlogn) then
checking two tree for identical O(N) overall O(nlogn) ..we
need there exist O(N) Time & O(1) Space also without extra
space .Algorithm ??
DevoCoder
guest
Posted 3 months ago #
#define true 1
#define false 0
int check(int a1[],int a2[],int n1,int n2)
{
int i;
//n1 size of array a1[] and n2 size of a2[]
if(n1!=n2) return false;
//n1 and n2 must be same
for(i=0;i