# Aspire System Written Test Papers

Posted on :09-04-2016
Q1. Steven had a son. His son was born five years after Stevens marriage. His son dead four years ahead of him. When Steven died his sons age was half of his age. Steven spent 1/7th of his life as in childhood, 1/6th of his life as adult and 1/12th as bachelor. What is the age of Steven when he died?

ANS: 84

Q2. 20 litres of a mixture contains milk and water in the ratio 3:2. 10 litres of the mixture was removed and replaced with pure milk. Then the procedure was repeated once. At the end of two replacements what is the ratio of milk & water?

ANS: 9:1

Q3. In a zoo when the zoo-keeper counted the number of heads he found it to be 80. But when he counted the number of legs he found it to be 260.The zoo contained either horse or pigeon. The numbers of horses in the zoo was?

ANS: 50

Q4. Nine people went to a hotel. 8 people paid 12rs each of them and the ninth paid 8rs more than the average of all the nine people. The total amount paid by them was?

ANS: 117

Q5. A man when he travels at 3 kmph he reaches the station 2 mins late. However when he travels at 4 kmph he reaches 2 mins quick. Find the distance the man has to travel?

ANS: 4/5 km

Q6

#define var(a,f,g,)
#define ...........
#define ..............
,, ,,
,, ,,
main()
{
#if def cat
printf("cat");
#else
printf("tiger");
}

Q7. What is the output of the program

#include
#include
void main()
{
int i,j=20;
clrscr();
for(i=1;i<3;i++)
{
printf("%d,",i);
continue;
printf("%d",j);
break;
}
getch();
}

A. 1,20
B. 1,20,1,20
C. 1,2
D. 1,2,20,20

ANS: c

Q8. What is the output of the program

#include
#include
void main()
{
char *st1[3]= {"Hello","World","Oracle"};
*st1=st1[2];
st1[1]=*st1;
free(st1[0]);
free(st1[1]);
clrscr();
printf("%s %s %s",st1,st1[1],st1[2]);
getch();
}

A. Garbage Garbage Oracle
B. oracle oracle oracle
C. Hello World Oracle
D. Core Dump:cannot Print after freeing the memory

ANS: D

Q9. What is the output in the following program

main()
{char c=-64;
int i=-32
unsigned int u =-16;
if(c>i)
{printf("pass1,");
if(c
printf("pass2");
else
printf("Fail2");
}
else
printf("Fail1);
if(i
printf("pass2");
else
printf("Fail2")
}

a) Pass1,Pass2
b) Pass1,Fail2
c) Fail1,Pass2
d) Fail1,Fail2
e) None of these

ANS: (c)

Q10. What will the following program do?

void main()
{
int i;
char a[]="String";
char *p="New Sring";
char *Temp;
Temp=a;
a=malloc(strlen(p) + 1);
strcpy(a,p); //Line number:9//
p = malloc(strlen(Temp) + 1);
strcpy(p,Temp);
printf("(%s, %s)",a,p);
free(p);
free(a);
} //Line number 15//

a) Swap contents of p & a and print:(New string, string)
b) Generate compilation error in line number 8
c) Generate compilation error in line number 5
d) Generate compilation error in line number 7
e) Generate compilation error in line number 1

Ans. (b)

FreshersLive - No.1 Job site in India. Here you can find latest 2020 government as well as private job recruitment notifications for different posts vacancies in India. Get top company jobs for both fresher and experienced. Job Seekers can get useful interview tips, resume services & interview Question and answer. Practice online test free which is helpful for interview preparation. Register with us to get latest employment news/rojgar samachar notifications. Also get latest free govt and other sarkari naukri job alerts daily through E-mail.

 ✖