ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Code Snippets  >>  Programming Code  >>  C Code
 
 


 

 
 C Code interview questions  C Code Interview Questions
 C++ Code interview questions  C++ Code Interview Questions
 VC++ Code interview questions  VC++ Code Interview Questions
 Java Code interview questions  Java Code Interview Questions
 Dot Net Code interview questions  Dot Net Code Interview Questions
 Visual Basic Code interview questions  Visual Basic Code Interview Questions
 Programming Code AllOther interview questions  Programming Code AllOther Interview Questions
Question
Write a program that find and print how many odd numbers in 
a binary tree
 Question Submitted By :: Mellic
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Write a program that find and print how many odd numbers in a binary tree
Answer
# 1
struct node
{
int data;
struct node *l;
struct node *r;
};
typedef struct node *n;
int oddnos(n root)
{
static int count;
n cur = root;
if(cur!=NULL)
{
if(cur->data%2==1)
count++;
oddnos(root->l);
oddnos(root->r);
}
return count;
}
 
Is This Answer Correct ?    2 Yes 0 No
Raghuram.A
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
Given a list of numbers ( fixed list) Now given any other list, how can you efficiently find out if there is any element in the second list that is an element of the first list (fixed list) Disney2
Finding a number multiplication of 8 with out using arithmetic operator NetApp7
programming in c lanugaue programm will errror error with two header file one as stdio.h and other one is conio.h  1
Find your day from your DOB? Microsoft11
Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all. Microsoft2
How to return multiple values from a function?  4
Write, efficient code for extracting unique elements from a sorted list of array. e.g. (1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9). Microsoft8
Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like. Microsoft8
how can u draw a rectangle in C Wipro24
Given n nodes. Find the number of different structural binary trees that can be formed using the nodes. Aricent3
How do you write a program which produces its own source code as its output?  4
write a program to Insert in a sorted list Microsoft4
String copy logic in one line. NetApp7
how to return a multiple value from a function? Wipro1
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. Synergy2
How to access command-line arguments?  4
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal.  5
Write a function to find the depth of a binary tree. Adobe4
write the function. if all the character in string B appear in string A, return true, otherwise return false. Google7
How to reverse a String without using C functions ? Wipro8
 
For more C Code Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com