4th step to ZOHO - Technical Aptitude


 



                          TECHNICAL APTITUDE
1.What will be the output of following program ?
Note : int-4bytes
#include
int main()
{
    struct sample{
        int a;
        int b;
        sample *s;
    }t;
 
    printf("%d,%d",sizeof(sample),sizeof(t.s));
    return 0;
}

 
2.What will be the output of following program ?
#include
int main()
{
struct std
{
char name[30];
int age;
};
struct std s1={"Mike",26};
struct std s2=s1;
printf("Name: %s, Age: %d\n",s2.name,s2.age);
}
3.What will be the output of following program ?
#include
#include
int main()
{
    char str1[]="IncludeHelp",str2[]=".Com";
    printf("%s",str1+strlen(str2));
    return 0;
}

4)Predict the output:
#include
int main()
{
    char str[]="Hello%s%dFriends";
    printf(str);
    printf("\n");
    printf("%s",str);
    return 0;
}
5)Predict the output
#include
#include
int main()
{
    char s1[]="IncludeHelp";
    char s2[10];
     
    strncpy(s2,s1,5);
    printf("%s",s2);
    return 0;
}

6) Predict the output
#include
int main()
{
    char *str="IncludeHelp";
    while(*str)
        printf("%s\n",str++);
    return 0;
}
7. ) Predict the output
#include
int main()
{
    int a=10,b=2;
    int *pa=&a,*pb=&b;
    printf("value = %d", *pa/*pb);
    return 0;
}
8. Predict the output
#include
#define TEXT IncludeHelp
int main()
{
    printf("%s",TEXT);
    return 0;
}
9. Predict the output
#include
#define MAX 99
int main()
{
    printf("%d...",MAX);
#undef MAX
    printf("%d",MAX);
    return 0;
}
10. Predict the output
#include
int main(){
    char val=250;
    int  ans;
    ans= val+ !val + ~val + ++val;
    printf("%d",ans);
    return 0;
}
11. Predict the output
#include
int main()
{
    int x,y;
    x=(100,200);
    y=100,200;
    printf("x=%d,y=%d",x,y);
  return 0;
}
12. Predict the output
#include < stdio.h >
void main()
{   unsigned char var=0;
    for(var=0;var<=255;var++)
    {
        printf("%d ",var);
    }
}
13. Predict the output
#include
#define TRUE 1
int main()
{
    int loop=10;
    while(printf("Hello ") && loop--);
}
14. Predict the output
#include
void main()
{
int k = 8;
int x = 0 == 1 && k++;
printf("%d %d\n", x, k);
}

15. Predict the output
#include
main()
{
int x=4;
printf("%d",printf(" %d %d ",x,x) );
}


Comments

  1. Today's questions are challenging...

    ReplyDelete

Post a Comment

Popular Posts