Topic — Add New » Posts Last Poster Freshness
Precedence 5 avdd80 17 hours

Please explain the associativity and order of execution in this statement
b= a + ++b + (a-b);
() has the highest precedence. but a-b is not executed first..
It is just executed from left to right

inheritance 4 vikram.kuruguntla 4 days

implementing stacks and queues using inheritance from linked list???

value substitution 3 vikram.kuruguntla 6 days

This statement swaps the values in a and b :
b=a+b-(a=b);
can anyone plz explain the steps involved in the execution of this statement...
I guessed a=b would be executed first since it is inside brackets.. then the statement will become :
b=a+b-b; But a=b has been executed so variable a is supposed to contain the value of b & it would be like :
b=b+b-b; //But this doen't happen

Instead values of a & b are swapped.. Please explain steps involved i...

FB HACKER CUP QUESTION 1 geekologic 1 week

You are racing on a 2D lattice grid starting from the origin (0,0) towards a goal (M,N) where M and N are positive integers such that 0 < M <= N. There is a checkpoint that's neither on the origin nor on the goal with coordinates (m,n) such that 0 <= m <= M and 0 <= n <= N. You must clear the checkpoint before you reach the goal. The shortest path takes T = M + N steps.
At each point, you can move to the four immediate neighbors at a fixed speed, but since you don't wa...

sorting 2 kartik 1 week

Q. write an algorithm to sort the n element of an array having element 1 to n , without using extra static variable ,global variable ,any extra space like other array?

Output of C program 3 PINTUGUPTAJUIT 1 week
#include<stdio.h>

int main()
{
  int i, j;
  int arr[4][4] = { {1, 2, 3, 4},
                    {5, 6, 7, 8},
                    {9, 10, 11, 12},
                    {13, 14, 15, 16} };
  for(i = 0; i < 4; i++)
    for(j = 0; j < 4; j++)
      printf("%d ", j[i[arr]] );

  printf("\n\n");

  for(i = 0; i < 4; i++)
    for(j = 0; j < 4; j++)
      printf("%d ", i[j[arr]] );

  return 0;
}
Array - all 1s 1 k53 1 week

The elements of an array are 1s and 0s. Change all the elements of this array as 1.
Use only a single statement and do not use any operator other than the assignment operator

Finding no. of elements in an integer array 5 k53 1 week

How to find the number of elements in an integer array ?
Cannot append NULL at the end and check for it bcoz the element 0 will be mistaken as NULL

n=sizeof(arr)/sizeof(arr[0]);
This gives the entire predefined size and not the no. of elements in it

Traverse Knight in ChessBoard problem 1 vpshastry 1 week

I've written a code to traverse a knight to all the squares on a chess board only once. The problem with this(below) code is, its working till 7x7 and doing nothing after 8x8. The code is
Here [b]chessBoardSize[/b] defines the size(8=> 8x8)

#include<stdio.h>
#include<stdlib.h>
#define chessBoardSize 8

int chessBoard[chessBoardSize][chessBoardSize] = {0};
typedef struct point{
	int x, y;
}POINT;
int count=0;

int nextPosition(int x, int y, POINT* array){
	int m=...
inbuilt container for building a balanced BST in stl c++ 1 gaurav 1 week

let say we want to build a binary search tree(BST) in a c++.
we can use a map for that.
map builts the "balanced" BST in the form of red black tree.

now we want to a built a balanced BST in which we also want to modify the contents of
internal nodes while inserting a node in bst.
e.g each node has a member 'count' which is equal to number of nodes in left subtree. In this case
we need to modify internal nodes too.
In this case which inbuilt contain...

linkedlist subtraction multiplication and division 1 ragini 2 weeks

i need to do subtraction multiplication and divison on linked list...can any one help me

system programming (can anyone explain the output) 2 kartik 2 weeks
#include <stdio.h>
#include <ctype.h>

void fn(int x, int y);

int main(void)
{
    int a = 4;
    int b = -4;

    printf("[%s, %s, %c]\n", "\12" "3", "\123", "\123");

    printf("[a: %d, b: %d]\n", a>>-1, b>>1);

    printf("Mod variants: 5,3 [Q: %2d, R: %2d]\n", 5/3, 5%3);
    printf("Mod variants: -5,3 [Q: %2d, R: %2d]\n", -5/3, -5%3);
    printf("Mod variants: 5,-3 [Q: %2d, R: %2d]\n", 5/-3, 5%-3);
    printf("Mod variants: -5,-3 [Q: %2d, R: %2d]\n", -5/-3, -5%...
Can We instantiate a zero member class? 2 kartik 3 weeks

Can anybody tell whether we can instantiate a zero member class or not??
If yes what is the size of the object

eg:
Class A{

}

A a

Is it valid to create a...if yes what is the size of object a

Write a C program to Transpose 2 Matrices and find their product 1 Pramod 3 weeks

Write a C program to Transpose 2 Matrices and find their product

volatile and constant variable 4 sreeja 3 weeks

Can a variable be qualified with both const and volatile at the same time?

extern int const volatile *port;

Is the above code allowed in C/C++ programming?

string reverse 6 aks 4 weeks

c program for sting statement reversing order to display.

ex.
input:
have a nice day.
output:
day nice a have.

linux 3 4 weeks

can anyone explain me ...how to make a process as daemon process...
???