Creativo - the topper's choice

www.creativo.co.in ( Placement papers of all companies are here )

Monday, May 01, 2006

Ramco

1) Find the output for the following C program
main(){char *p1="Name";char *p2;p2=(char *)malloc(20);while(*p2++=*p1++);printf("%s\n",p2);}
Ans. An empty string
2) Find the output for the following C program
main(){intx=20,y=35;x = y++ + x++;y = ++y + ++x;printf("%d %d\n",x,y);}
Ans. 57 94
3) Find the output for the following C program
main(){int x=5;printf("%d %d %d\n",x,x<<2,x>>2);}
Ans. 5 20 1
4) Find the output for the following C program
<>#defineswap1(a,b)a=a+b;b=a-b;a=a-b;main(){intx=5,y=10;swap1(x,y);printf("%d %d\n",x,y);swap2(x,y);printf("%d %d\n",x,y);}int swap2(int a,int b){int temp;temp=a;b=a;a=temp;return;}
Ans. 10 5
5) Find the output for the following C program
main(){char *ptr = "Ramco Systems";(*ptr)++;printf("%s\n",ptr);ptr++;printf("%s\n",ptr);}
Ans. Samco Systems
6) Find the output for the following C program
#includemain(){char s1[]="Ramco";char s2[]="Systems";s1=s2;printf("%s",s1);}
Ans. Compilation error giving it cannot be an modifiable 'lvalue'
7) Find the output for the following C program
#includemain(){char *p1;char *p2;p1=(char *) malloc(25);p2=(char *) malloc(25);strcpy(p1,"Ramco");strcpy(p2,"Systems");strcat(p1,p2);printf("%s",p1);}
Ans. RamcoSystems
8) Find the output for the following C program given that[1]. The following variable is available in file1.cstatic int average_float;
Ans. All the functions in the file1.c can access the variable
9) Find the output for the following C program
# define TRUE 0some codewhile(TRUE){some code }
Ans. This won't go into the loop as TRUE is defined as 0
10) Find the output for the following C program
main(){int x=10;x++;change_value(x);x++;Modify_value();printf("First output: %d\n",x);}x++;change_value(x);printf("Second Output : %d\n",x);Modify_value(x);printf("Third Output : %d\n",x);}Modify_value(){return (x+=10);}change_value(){return(x+=1);}
Ans. 12 1 1
11) Find the output for the following C program
main(){intx=10,y=15;x=x++;y=++y;printf("%d %d\n",x,y);}
Ans. 11 16
12) Find the output for the following C program
main(){int a=0;if(a=0) printf("Ramco Systems\n");printf("Ramco Systems\n");}
Ans. Ony one time "Ramco Systems" will be printed
13) Find the output for the following C program
#includeint SumElement(int *,int);void main(void){int x[10];int i=10;for(;i;){i--;*(x+i)=i;}printf("%d",SumElement(x,10));}int SumElement(int array[],int size){int i=0;float sum=0;for(;ivoid main(void);int printf(const char*,...);void main(void){inti=100,j=10,k=20;-- int sum;float ave;charmyformat[]="ave=%.2f";sum=i+j+k;ave=sum/3.0;printf(myformat,ave);}
Q15) Find the output for the following C program
#includevoid main(void);{int a[10];printf("%d",((a+9) + (a+1)));}
Q16) Find the output for the following C program
#includevoid main(void){struct s{int x;float y;}s1={25,45.00};union u{int x;float y;} u1;u1=(union u)s1;printf("%d and %f",u1.x,u1.y);}
Q17) Find the output for the following C program
#includevoid main(void){unsigned int c;unsigned x=0x3;scanf("%u",&c);switch(c&x){case 3: printf("Hello!\t");case 2: printf("Welcome\t");case 1: printf("To All\t");default:printf("\n");}}
Q18) Find the output for the following C program
#includeint fn(void);void print(int,int(*)());int i=10;void main(void){int i=20;print(i,fn);}void print(int i,int (*fn1)()){printf("%d\n",(*fn1)());}int fn(void){return(i-=5);}
Q19) Find the output for the following C program
#includevoid main(void);{char numbers[5][6]={"Zero","One","Two","Three","Four"};printf("%s is %c",&numbers[4][0],numbers[0][0]);}
Q20) Find the output for the following C program
int bags[5]={20,5,20,3,20};void main(void){int pos=5,*next();*next()=pos;printf("%d %d %d",pos,*next(),bags[0]);}int *next(){int i;for(i=0;i<5;i++)if>void main(void){inty,z;
intx=y=z=10;int f=x;float ans=0.0;f *=x*y;ans=x/3.0+y/3;printf("%d %.2f",f,ans);}
Q22) Find the output for the following C program
#includevoid main(void);{doubledbl=20.4530,d=4.5710,dblvar3;double dbln(void);dblvar3=dbln();printf("%.2f\t%.2f\t%.2f\n",dbl,d,dblvar3);}double dbln(void){double dblvar3;dbl=dblvar3=4.5;return(dbl+d+dblvar3);}
Q23) Find the output for the following C program
#includestatic int i=5;void main(void){int sum=0;do{sum+=(1/i);}while(0void main(void){intoldvar=25,newvar=-25;int swap(int,int);swap(oldvar,newvar);printf("Numbers are %d\t%d",newvar,oldvar);}int swap(int oldval,int newval){int tempval=oldval;oldval=newval;newval=tempval;}
Q25) Find the output for the following C program
#includevoid main(void);{inti=100,j=20;i++=j;i*=j;printf("%d\t%d\n",i,j);}
Q26) Find the output for the following C program
#includevoid main(void);int newval(int);void main(void){int ia[]={12,24,45,0};int i;int sum=0;for(i=0;ia[i];i++){sum+=newval(ia[i]);}printf("Sum= %d",sum);}int newval(int x){static int div=1;return(x/div++);}

Q27) Find the output for the following C program
#includevoid main(void);{int var1,var2,var3,minmax;var1=5;var2=5;var3=6;minmax=(var1>var2)?(var1>var3)?var1:var3:(var2>var3)?var2:var3;printf("%d\n",minmax);
Q28) Find the output for the following C program
#includevoid main(void);{void pa(int *a,int n);int arr[5]={5,4,3,2,1};pa(arr,5);}void pa(int *a,int n){int i;for(i=0;ivoid main(void);void print(void);{print();}void f1(void){printf("\nf1():");}
Q30) Find the output for the following C program
#include "6.c"void print(void){extern void f1(void);f1();}static void f1(void){printf("\n static f1().");}
Q31) Find the output for the following C program
#includevoid main(void);static int i=50;int print(int i);void main(void){static int i=100;while(print(i)){printf("%d\n",i);i--;}}int print(int x){static int i=2;return(i--);}
Q32) Find the output for the following C program
#includevoid main(void);typedef struct NType{int i;char c;long x;} NewType;void main(void){NewType *c;c=(NewType *)malloc(sizeof(NewType));c->i=100;c->c='C';(*c).x=100L;printf("(%d,%c,%4Ld)",c->i,c->c,c->x);}
Q33) Find the output for the following C program
#includevoid main(void);const int k=100;void main(void){int a[100];int sum=0;for(k=0;k<100;k++)*(a+k)=k;sum+=a[--k];printf("%d",sum);} b ="b*a">AM ( A Triangle is given )
1) AB 3x - 20
Ans: D
Q22) Of the two which one is the greater -- -3/x , -3/y?
1) x,y>02) xAns: C
Q23) What percentage of the candidates passed both in science and mathematics?
1) 52 percent of the candidates failed in science 2) 42% of the candidates failed in mathematics
Ans: C
Q24) How much pure H2SO4 (Hydro Sulphuric Acid) should be added to bring down the percentage of impuritity to 5%?
1). 50 liters of pure H2SO4 was diluted2). dilution was to the extent of 20%
Ans:C
Q25) What is the cost of building when archtects feeses was 70,000
1. Architect gets 10% for the first Rs. 50000 of the cost of building2. Architect gets 3% on the cost of the building over 50000
Ans:C
Q26) What is the value of BC?( here one triangle figure is there )
1). AP=42). PQ=5
Ans: E
Q27) What is the area of the shaded portion (assume AB, CD are arcs of two circles with centre at 0.)Here one arc figure is there
1). CA=20m2). CB=5m
Ans:C
Q28) What is the area of the greatest circle that can be out from rectangular paper
1). length of the paper is 30cm2). Width of the paper is 21cm
Ans:B
Q29) Y is what percentage of X?
1). 0.3x=Y 2). 3x-10y=0
Ans:D
Q30) What is the area of the trapezium abcd where ab is 5cm
1. BC=7CM2. AB+CD= 16CM

Directions :- Each sentence below has one or two blanks.Choose the word from the set of words for each blank that best fits the meaning of the sentence as a whole.
Q31) The air was bitter cold, the temperature well below the freezing point , yet they found themselves ------ freely as they clambered up the steep northern slope
Ans: disporting
Q32) We were taken when we heard of his defection , never having suspected that he was anything but loyal. So capable had been his ---- or and devotion to cease
Ans: presentiment
Q33) War and peace are mutually ------- states of being and war to preserve peace is not a paradox . It is a -----
Ans: incompatible -- contradiction
Q34) Although the injury appeared ------, the examination by the ophthomologist revealed that he would need immediate surgery to save his sight.
Ans: superficial
Q35 to Q40 - On similar pattern as above.
Antonyms
Q41. corroborative ---- refutable
Q42. obnoxious ---- harmless
Q43. sanction ---- hinder
Q44. empirical ---- experimental
Q45. aborigine ---- emigrant

Directions for questions 56- 60 . Questions 56 -60 are based on the following information:
A port has four berths W,V,X,Y. Of these two are general cargo berth, one is a fertiliser berth and one is for liquid cargo, When vessel A arrived it was berthed at berth V but vessel B which along with A had to wait prior to berthing as vessel C was working in berth Y and vessel D was working in berth W .Vessel E came to unload fertiliser and did not have to wait. All are specilised berths i.e. general cargo vessel has to work only in a general cargo berth. So is true for fertiliser vessel and liquid cargo vessel.
Q56. The vessel E should be alotted to the berth.
Ans: X
Q57. Which of the following berth can accept a vessel carrying liquid cargo--W, V, X, Y
Ans: V
Q58. Which of the following is not a general cargo vessel--A ,B, C, D, E
Ans:A
Q59. Total number of general cargo vessels mentioned in the above description is
Ans:3
Q60. Whcih of the following allotments is possible
Ans: B to W

0 Comments:

Post a Comment

<< Home