Recommended For You

Tuesday, September 29, 2020

Infosys Output Based Questions [Pseudo Code] 2020 Hiring Solution Practise

   



    


In Output Based Questions [Pseudo Code] 


                                                    

  
      Clik To Join Telegram To Stay Updated


1. What will be the output of following code :

#include<stdio.h>
int main()
{
int go = 5.0, num = 1*10;
do 
{
num /= go;
} while(go--);
printf ("%d\n", num);
return 0;
}

A. Floating Point Exception
B. 3 6 7
C. Compile Error
D. Runtime Error

Ans. A



2. What will be the output of following code :


#include <stdio.h>
int main()
{
    float x = 0.0;
    long int y = 10;
    printf("%d", sizeof(y) == sizeof(+ y));
    return 0;
}

A. 4
B. 1
C. 8
D. 0

Ans. D



3. What will be the output of following code :

#include <stdio.h>
int main()
{
    int any = ' ' * 10;
    printf("%d", any);
    return 0;
}

A. 320
B. 380
C. 390
D. 400

Ans. A



4. What will be the output of following code :


#include <stdio.h>
int main()
{
    float i;
    i = 1;
    printf("%d", i);
    return 0;
}

A. Garbage value
B. 1
C. 1.0
D. Error 

Ans. A



5. What will be the output of following code :

#include <stdio.h>
int main()
{
    int num = 987;
    int rem;
    while (num != 0)
    {
        rem = num % 4;
        num = num / 10;
    }
    printf("%d", rem);
}

A. 1
B. 3
C. 0
D. 2

Ans. A

6. What will be the output of following code :

#include <stdio.h>
int main()
{
    typedef int num;
    num bunk = 0.00;
    printf("%d", bunk);
    return 0;
}


A. 0
B. 0.0
C. Error
D. Garbage Value

Ans. A





Tuesday, September 1, 2020

DXC Output Based Questions [Pseudo Code]

  


    

DXC Output Based Questions [Pseudo Code] 


                                                    

 
      Clik To Join Telegram To Stay Updated


1. What will be the output of following code :

#define clrscr() 100; main(){
clrscr();
printf(%d\n\t, clrscr());
}

A. 100
B. 10
C. Compile Error
D. Runtime Error

Ans. A



2. What will be the output of following code :


int main()
{
void vpointer;

char cHar = g,cHarpointer = GOOGLE;

int j = 40;

vpointer = &cHar;

printf(“%c”,(char)vpointer);

vpointer = &j;

printf(“%d”,(int )vpointer);

vpointer = cHarpointer;

printf(“%s”,(char)vpointer +3);
}

A. 40
B. 100
C. ERROR
D. Warning

Ans. C



3. What will be the output of following code :

int main(){
int i;
if(true)
printf(“work”);
else
printf(“not work”);
return 0;
}

A. work
B. not work
C. compiler error
D. runtime error

Ans. A



4. What will be the output of following code :

int main()
{
if(printf(“0”))
printf(“inside if block”);
else
printf(“inside else block”);
return 0;
}

A. inside else block
B. 0
C. 0inside if block
D. Error – If can not have print statement

Ans. C



5. What will be the output of following code :

int main()
{
int a = NULL – true;
printf(“%d”,a);
return 0;
}

A. -1
B. Garbage value
C. 0
D. Error

Ans. -1

6. What will be the output of following code :

main()
{
extern int iExtern;
iExtern = 20;
printf(%d,iExtern);
}

A. 2
B. 20
C. Error
D. Warning

Ans. C