Write a program that find and print how many odd numbers in
a binary tree
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 ? | 8 Yes | 5 No |
Printf can be implemented by using __________ list.
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal.
6 Answers Fusion Systems GmbH,
main() { int i=_l_abc(10); printf("%d\n",--i); } int _l_abc(int i) { return(i++); }
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)
3 Answers Disney, Google, ZS Associates,
main() { printf("%d", out); } int out=100;
write a c program to Reverse a given string using string function and also without string function
What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?
x=2 y=3 z=2 x++ + y++; printf("%d%d" x,y);
What is the output for the following program main() { int arr2D[3][3]; printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0])) ); }
char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }
main() { char *p = “ayqm”; char c; c = ++*p++; printf(“%c”,c); }
void pascal f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } void cdecl f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } main() { int i=10; f(i++,i++,i++); printf(" %d\n",i); i=10; f(i++,i++,i++); printf(" %d",i); }