what is the output of the following program?
main()
{
int c[]={2,8,3,4,4,6,7,5};
int j,*p=c,*q=c;
for(j=0;j<5;j++)
{
printf("%d",*c);
++q;
}
for(j=0;j<5;j++)
{
printf("%d",*p);
++p;
}
}
Answer Posted / abhradeep chatterjee
2222228344 will be the answer. I think everybody answered
before me is correct.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Explain what is a program flowchart and explain how does it help in writing a program?
What are the different types of C instructions?
When is a “switch” statement preferable over an “if” statement?
What are the preprocessor categories?
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
What is meant by type casting?
What do you mean by scope of a variable in c?
can we have joblib in a proc ?
how should functions be apportioned among source files?
What is the difference between mpi and openmp?
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
What are the disadvantages of c language?
Can you add pointers together? Why would you?
What is use of bit field?
Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?