Topic — Add New » Posts Last Poster Freshness
Precedence 5 avdd80 16 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

if else 6 PINTUGUPTAJUIT 1 week

int a=10,b=10;
if(a=b)
cout<<"equal";
else
cout<<"Not Equal";

output:
Not equal

Microsoft Interview Question for Software Testing (0 - 2 Years) about CPuzzles 2 Aashish Barnwal 3 weeks

implement factorial, do remeber to handle the overflow case, which is actually the key point, otherwise this problem will be too simple

Microsoft
c programs 5 kartik 3 weeks

Write a program which prints itself.

Microsoft Interview Question for Software Engineer/Developer (Fresher) about CPuzzles 6 Abhijeet 4 weeks
    char str[80];
    strcpy(str,"junk");
    scanf("%[^india]",str);
    printf("%s",str);

What will be the output of this code snippet if the given
input is “Gujarat”?

Microsoft
Microsoft Interview Question for Software Engineer/Developer (Fresher) about CPuzzles 5 jai 1 month

Give the output of the following program

int main
{
    char ch[]={‘1’,’2’,’3’,’4’,’5’};
    char *p = (char *)(&ch+1);
    char *q = &ch+1;
    printf(“%d     %c    %c”,sizeof(ch),*(p-1),*q);
}
Microsoft
Microsoft Interview Question for Software Engineer/Developer (Fresher) about CPuzzles 11 Aashish Barnwal 1 month
  int x=123,y=231;
  int t=0;
  int l;
  l=x^y;
  while(l)
  {
      t++;
      l&=l-1;
  }
  printf("%d",t);
Microsoft
Microsoft Interview Question for Software Engineer/Developer (Fresher) about CPuzzles 2 Aashish Barnwal 1 month
int main()
{
    double i=2.0,j=1.0,sum=0.0;
    while(i/j>0.001)
    {
        j=j+j;
        sum=sum+(i/j);
        printf("%f\n",sum);
    }
}

The question here is : For how many steps this while loop will run and
what would be the best approximate value of the sum after the loop
ends .

Microsoft
Amazon Interview Question for Software Engineer/Developer about CPuzzles 3 prabhat 1 month

Find out what this function does.

int foo(int n) {
      int t,count=0;
      t=n;
      while(n)
      {
          count=count+1;
          n=(n-1)&t;
      }
      return count;
}
Amazon
printing 2 1 month

how to print 2.3 instead of 2.300000 float type without using .1f;...........

C Program 2 kartik 1 month

write a program to accept an array of elements and divide each element in array by 3

c array question 2 1 month

can we defined array without specifying size in c ?

A C structure padding question 9 Kapil 1 month

how can we turn-off the padding in structures?

what will the output and why? 3 1 month
#include<stdio.h>
int main()
{
    printf("%%dd",12);
    getchar();
    return 0;
}
Microsoft Interview Question for Software Engineer/Developer about CPuzzles 9 ankiee 1 month

allocate 2D array dynamically with min no. of malloc calls.

Microsoft
reverse a number 3 Saurabh 1 month

how to reverse a number in c without the use of any function

Using console application to create this program. 6 Sharad Dixit 1 month

Can you specify a porgram to print the numbers from 1 to 10 and their squares without using a loop?