1. What will be the output of the following programs.
a) #include <stdio.h>
Main()
{
Int x=4;
While(x==1)
{
X=x-1;
Printf(ā€œ%dā€,x);
--x;
}
}

Answer Posted / palani222samy

empty

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is optimization in c?

556


What is a nested loop?

635


Explain that why C is procedural?

642


What are the __date__ and __time__ preprocessor commands?

559


What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?

596






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

633


Explain two-dimensional array.

611


Describe static function with its usage?

595


What is pointer and structure in c?

554


How do we declare variables in c?

556


i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none

634


What is the scope of static variable in c?

513


Why do some versions of toupper act strangely if given an upper-case letter?

622


How can you determine the maximum value that a numeric variable can hold?

619


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;ia1[i+1]) && (a2[i]>a2[i+1]) ) ) return false; } return true;//assumed that each array doesn't contain duplicate elements in themshelves }

2694