JobseekersIndia

Welcome to JobSeekersIndia.

JobSeekersIndia Provides Latest Job updates in India , Freshers Job Openings, WalkIn Updates, Off Campus Interviews, Government Jobs, IT/Software Jobs, Bank Jobs, BPO CallCenter Jobs Internships Jobs in Various industries, Interview question Papers, Interview Tips, Company Addresses, Placement papers, Internship projects, Details about companies, Resume Writing Tips, Fake companies List and More..

Search Your Dream Job Here

Oracle Company Profile

Oracle Corporation (Nasdaq: ORCL) is the world's leading supplier of software for information management, and the world's second largest independent software company. With annual revenues of more than $10.1 billion, the company offers its database, tools and application products, along with related consulting, education, and support services, in more than 145 countries around the world. Headquartered in Redwood Shores, California, Oracle is the first software company to develop and deploy 100 percent internet-enabled enterprise software across its entire product line: database, server, enterprise business applications, and application development and decision support tools. 
Oracle is the only company capable of implementing complete global e-business solutions that extend from front office customer relationship management to back office operational applications to platform infrastructure. Oracle software runs on PCs, workstations, minicomputers, mainframes and massively parallel computers, as well as on personal digital assistants and set-top devices. As more and more companies transform themselves into e-businesses, Oracle's Internet-enabled solutions provide a cost-effective way to expand market opportunities, improve business process efficiencies, and attract and retain customers. By replacing expensive, unwieldy client/server computing models with the efficiency and reach of the internet, companies can deploy a wealth of innovative applications that can be accessed with a Web browser. 
The only software company to offer a full suite of e-business products, Oracle provides: 
Ø  An Internet-ready platform for building and deploying Web-based applications 
Ø  A comprehensive suite of Internet-enabled business applications 
Ø  Professional services for help in formulating e-business strategy, as well as in designing, customizing,  and implementing e-business solutions

Oracle: Past, Present and Future:


The beginnings:
When CEO Lawrence J. Ellison and a few associates formed Oracle in 1977, they were out to prove wrong the prevailing theory that relationship databases could not be commercially viable. 
Larry Ellison, Bob Miner and Ed Oates found Software Development Laboratories. Inspired by a research paper written in 1970 by an IBM researcher titled " A Relational Model of Data for Large Shared Data Banks", the three decide to build a new type of database called a relational database system. Their orginal project is for the government and is titled Oracle. The founders believe that Oracle, meaning source of wisdom, would be an appropriate name for their project and receive permission from the CIA to use it.
What's in a name?
In 1978, Software Development Laboratories moved from their office in Santa Clara to a new one on Sand Hill Road in Menlo Park, the heart of Silicon Valley. In an attempt to explain what their company does, they changed their name to Relational Software Inc., or RSI. The newly-christened company shipped its first commercial SQL-based database, V2, in 1979 (V1 was never officially released). In 1982 RSI changed its name to Oracle Systems Corporation, which later become Oracle Corporation.

Tapping the Internet:
In 1983, Oracle decided to make RDBMS portable, and introduced V3 - the first portable database to run on PCs, mini computers and mainframes. Today, Oracle targets high-end workstations and mini computers as the server platforms on which to run its database systems. Along with few others, Oracle has long been a champion of network computers. It now boasts that is was the world's first software company to develop and deploy 100 percent Internet-enabled enterprise software across its entire product line: database, server, enterprise business applications, applications development and decision support tools. In fact, CEO Ellison has said, "If the Internet turns out not to be the future of computing, we're toast. But if it is, we're golden."

A phenomenal success story:
Today, as proof of their success, they've parlayed an initial $2,000 investment in the company into an annual revenue exceeding $10.1 billion. Based in Redwood shores, California, it has more that 43,000 employees worldwide and does business in over 150 countries. Oracle (ORCL) is publicly traded on the NASDAQ.

Company Website: http://www.oracle.com


Search tags:

Oracle Company profile  Oracle New Company Profile  Oracle  Profile 2012  Oracle Software company profile  Oracle India  Top IT Company Oracle Profile  Details About Oracle  Oracle  Chennai  Oracle Bangalore  Oracle Noida  Oracle Hyderabad  Oracle Mumbai  Oracle India Company Profile
Jobs in Oracle India  Search Jobs in Oracle India  Career registration link for Oracle India  Start your career in Oracle India  Job Opening in Oracle India  Search Thousands of Jobs in Oracle India  Apply Online For Jobs in Oracle India  Jobs in Oracle India Apply Online now

How To Explain Your Project During Interviews

Generally during interviews you would be asked to explain one or two of your major/mini projects that you would had done during your college days. This actually is a very important question, not because of the content or technical details involved, but because it can clearly give insights about your capability to work in a team, capability to understand concepts and to practically implement the same etc.

Why you should not be too technical?

          The question about your project should not be seen as your exam question, where you will draw a diagram and write a long (or prolonged essay to fill pages ) monologue which only technically super sound people can appreciate. But interviewers are generally not well versed in all of the technologies or concepts the engineering students are aware. For instance, they might know what is CDMA but may not know in depth how it aids noise reduction. Again for example, they might know VLSI concepts buy may not know how to use VLSI software to implement and simulate.

Shouldn't You Be Technical At All?

Not being too technical doesn't mean your answer should be vague/superficial. You will have to give necessary technical points that average tech person would understand.

Is there an exception?
Yes, in case if you find your interviewer a master in your area of project work, there is absolutely no harm in explaining in detail.

What Other Aspects You Should Cover ?

Explaining your contribution to the project is equally important as explaining project itself. This will clearly portray your understanding clarity of your part/module, your ability to work efficiently in a team etc

All the best….:)

Download Sample Resume Format- Free Sample Resume formats

Download Resume Format-Sample Resume Formats free Download, Interview Tips, Resume, Resume Writing Tips, Download Free, Sample Resumes, Sample Resume Formats, Fresher resume format.
            Download free Resume Format, Download free Fresher’s Resume Format, Download free Experienced Resume Format.


Here some of the sample resume formats for Freshers and experienced Candidates. Please use the following links to download those documents..







Important:
Downloading instructions: 
1.click the links
2. it will redirect you to google documents.
3. Click file-> Download As
and select the format to download..



You Might Like These Interview Tips Too 


Resume Building tips
 
Few Mistakes that may get your CV trashed- Tips To Write a Better Resume

Most Commonly Asked Interview Questions (Dos and Don'ts)

Group Discussion Topics And Answers

10 Killer Questions Candidates Must Ask the Interviewer

How To Explain Your Project During Interviews

General HR interview questions




Freshers  Resumes in India - Free download as PDF File Resumes
Download Free Sample Resumes. ... Resume Samples for Students, Resume Samples for Freshers, Resume Formats India
FRESHERS SAMPLE RESUME, TIPS, WRITING, FORMAT
Indian Resume Format Free Download
Indian Resume Format Download | The Best Sample Resume Sample Cover Letters free  Resume and Cover Letter Examples sample engineering resume
FREE CV  biodata format  resume samples  resume examples for Freshers  Experianced proffessionals
Freshers Resume Sample, Tips & Free Example
BE Resume formats Free BE BTech Resume Formats Sample BE Resumes Resume For MCA resume formats Frees Pdf Resume download.
BSc Resume formate free download BCA Resume Formats and ME MTech Resume Formats Free CV Formats CV Free Download pdf ME MTech Graduate Resumes,
MBA Resume Formates Resume for Masters Degree MBA free downloas MSc Resume Formates, free sample IT Company Resumes
Download Free Cover Letters for Resume
FRESHERS SAMPLE RESUME, TIPS, WRITING, FORMAT,DOWNLOAD FREE EXAMPLE Resume formates

Wipro Placement Paper-Wipro sample Interview Question paper

Wipro Placement Paper, Wipro, Common interview questions, Wipro Placement Paper, Interview Question Paper, Interview Questions, Technical interview Questions, Aptitude Questions, Verbal Questions, Non Verbal Questions, Company interview Questions,Wipro sample paper


Aptitude test :
Questions = 50; time limit = 50 minutes. No negative marking. Offline (paper & pen) test. There was individual cut off for all the sections

Section 1: English, 15 questions


Direction 1-5: In each of the following questions, find out which part of the sentence has an error. If there is no mistake the answer is 'no error'
1. Twice twelve / makes / twenty four / No error
A B C D
Ans: B
2. The flight purser took control / of the plane after / the pilot had had / a heart attack / No error
A B C D E
Ans: C
3. My friend did not see me / for many years / when I met him last week / No error
A B C D
Ans: A
4. We grieve our loss and cry helplessly / while we should be fighting for our rights / and die a noble death / No error
A B C D
Ans: B
5. Work hard / lest you will / fail / No error
A B C D
Ans: D
Directions 6-10: The following questions consist of two words each that have a certain relationship to each other, followed by four lettered pairs of words. Select the lettered pair that has the same relationship as the original pair of words.
6. Kangaroo: Australia
A) Whale: River B) Elephant: Russia C) Penguin: Antarctica D) India: Peacock
Ans: C
7. Coronation: Reign
A) Vaccination: Immunity B) Sculptor: Statue C) Degree : Graduate D) Summer: Rain
Ans: D
8. Grain: Salt
A) Chip: Glass B) Blades: Grass C) Shred: Wood D) Shard: Pottery
Ans: A
9. Scythe; Reaping
A) Light: Shining B) Shears: Cutting C) Saws: Gluing D) Screws: Turning
Ans: B
10. Dislike: Repulsion
A) Dream: Sleep B) Steal: Crime C) Reputation: Behavior D) Intelligence: Wit
Ans: D
Directions 11-12: In each of the following questions, a sentence has been given in Active (or passive) voice. Out of the four alternatives suggested select the one which best express the same sentence in Passive (or Active) Voice.
11. His pocket has been picked.
A) They have his pocket picked
B) Picking has been done to his pocket
C) Picked has been his pocket
D) Someone has picked his pocket.
Ans: D
12. Someone gave her a bull dog.
A) She was given a bull dog.
B) a bull dog was given to her
C) She has been given a bull dog
D) She is being given a bull dog by someone
Ans: B
Directions 13-15: Pick out the most effective word from the given words to fill in the blank to make the sentence meaningfully complete
13. He succeeded in getting possession..............his land after a long court case
A) For B) to C) of D) with E) against
Ans: C
14. Now a day Rajani is .............busy to take care of her health.
A) Very B) too C) so D) extremely
Ans: B
15. Had the police not reached there in time the bandits him
A) Did have killed B) will have killed C) would kill D) would have killed
Ans: D






Section 2: Aptitude 15 questions


The questions 1-5 are based on the following data six knights - P, Q, R, S, T and U - assemble for a long journey in two traveling parties. For security, each traveling party consists of at least two knights. The two parties travel by separate routes, northern and southern. After one month, the routes of the northern and southern groups converge for a brief time and at that point the knights can, if they wish, rearrange their traveling.
Parties before continuing, again in two parties along separate northern and southern routes. Throughout the entire trip, the composition of traveling parties must be in accord with the following conditions P and R are deadly enemies and, although they may meet briefly, can never travel together.
P must travel in the same party with S
Q can't travel by the southern route
U can't change routes
1. If one of the two parties of knights consists of P and U and two other knights and travels by the southern route, the other members of this party besides P and U must be
a) Q and S
b) Q and T
c) R and S
d) R and T
e) S and T
Ans: e
2) If each of the two parties of knights consists of exactly three members, which of the following is not a possible traveling party and route?
a) P,S,U by the northern route
b) P,S,T by the northern route
c) P,S,T by the southern route
d) P,S,U by the southern route
e) Q,R,T by the southern route
Ans: a
3) If one of the two parties of knights consists of U and two other knights and travels by the northern route, the other members of this party >besides U must be
a) P and S
b) P and T
c) Q and R
d) Q and T
e) R and T
Ans: c
4) If each of the two parties of knights consists of exactly three members of different parties, and R travels by the Northern route, then T must travel by the
a) southern route with P and S
b) southern route with Q and R
c) southern route with R and U
d) northern route with Q and R
e) northern route with R and U
Ans: a
5) If, when the two parties of knights encounter one another after a month, exactly one knight changes from one traveling party to the other traveling party, that knight must be
a) P b) Q c) R d) S e) T
Ans: e
6. X varies inversely as square of y. Given that y = 2 for x = 1. The value of x for y = 6 will be equal to
A) 3 B) 9 C) 1/3 D) 1/9
Ans: D
7. If 10% of x = 20% of y, then x: y is equal to
A) 1: 2 B) 2: 1 C) 5: 1 D) 10: 1
Ans: B
8. A starts business with Rs.3500 and after 5 months, B joins with A as his partner. After a year, the profit is divided in the ratio 2 : 3. What is B's contribution in the Capital?
A) Rs. 7500 B) Rs. 8000 C) Rs. 8500 D) Rs. 9000
Ans: D
9. Ronald and Elan are working on an assignment. Ronald takes 6 hours to type 32 pages on a computer, while Elan takes 5 hours to type 40 pages. How much time will they take, working together on two different computers to type an assignment of 110 pages?
A) 7 hours 30 minutes B) 8 hours C) 8 hours 15 minutes D) 8 hours 25 minutes
Ans: C
10. A and B can do a piece of work in 72 days; B and C can do it in 120 days; A dn C can do it in 4 days. Who among these will take the least time if put to do it alone?
A) 80 days B) 100 days C) 120 days D) 150 days
Ans: C
11. A cistern can be filled by a tap in 4 hours while it can be emptied by another tap in 9 hours. If both taps are opened simultaneously, then after how much time will the cistern get filled?
A) 4.5 hours B) 5 hours C) 6.5 hours D) 7.2 hours
Ans: D
12. Pipe a can fill a tank in 5 hours, pipe B in 10 hours and pipe C in 30 hours. If all the pipes are open, in how many hours will the tank completely?
A) 6 min. to empty B) 6 min to fill C) 9 min. to empty D) 9 min. to fill
Ans: C
13. A thief steals a car at 2.30 p.m and drives it at 60 kmph. The theft is discovered at 3 p.m and the owner sets off in another car at 75 kmph. When will be overtake the thief.
A) 4.30 p.m B) 4.45 p.m C) 5 p.m D) 5.15 p.m
Ans: E
14. Two trains starting at the same time from two stations 200 km apart, and going in opposite directions cross each other at a distance of 110 km from one of the stations. What is the ratio of their speeds?
A) 9: 20 B) 11: 9 C) 11: 20 D) None of these
Ans: B
15. Two trains each 100 m long, moving in opposite directions, cross each other in 8 seconds. If one is moving twice as fast the other, then the speed of the faster train is
A) 30 km /hr B) 45 km / hr C) 60 km/hr D) 75 km/hr
Ans: C






Section 3: Technical, 20 questions






Predict the output or error(s) for the following:
1. main()
{
char string[]="Hello World";
display (string);
}
void display (char *string)
{
printf("%s",string);
}
Ans: Compiler Error: Type mismatch in redeclaration of function display
2. What are the values printed by the following program?
#define dprint(expr) printf(#expr "=%d\n",expr)
main()
{
int x=7;
int y=3;
dprintf(x/y);
}
a) #2 = 2 b) expr=2 c) x/y=2 d) none
Ans: c
3) Parameterization generally involves
a. Data table
b. Random number
c. Environment
d. Both A & B
e. Both A, B & C
Ans: e
4) The file which is used for recovering from the run time errors known as
A. QRS B. TSR C. PNG D. DAT
Ans: A
5) Among the following recording modes, which method uses both the objects and mouse coordinates
a. Normal b. Low level c. Analog d. All of the above
Ans: b
6) Where do you set the action iterations for a specified action?
a. Action Settings
b. Action Properties
c. Action Run Properties
d. Action Call Properties
Ans: d
6) Where do you mark an action as reusable?
a. Action Settings
b. Action Properties
c. Action Run Properties
d. Action Call Properties
Ans: b
7) After running a test that contains both input and output parameters, where can the results of an output parameter be found?
a. Local Data Sheet
b. Global Data Sheet
c. Run-time Data Table
d. Design-time Data Table
Ans: c
8) If you have a Virtual Object Collection stored on your machine, and you don’t want to use it what you must do?
a. Disable Virtual Objects in Test Settings
b. Remove the Collection from your machine
c. Disable Virtual Objects in General Options
d. Remove the Collections from the Resources list
Ans: c
9. For a 25MHz processor, what is the time taken by the instruction which needs 3 clock cycles,
(a) 120 nano secs (b) 120 micro secs
(c) 75 nano secs (d) 75 micro secs
Ans: a
10. For 1 MB memory, the number of address lines required,
(a) 11 (b) 16 (c) 20(d) 24
Ans. (c)
11. Semaphore is used for
(a) synchronization (b) dead-lock avoidance (c) box (d) none
Ans. (a)
12. OLE is used in
a) Inter connection in UNIX
b) Interconnection in WINDOWS
c) Interconnection in WINDOWS NT
d)None
Ans: c
13. Preprocessor does not do which one of the following
(a) macro (b) conditional compliclation
(c) in type checking (d) including load file
Ans. (c)
14. Piggy backing is a technique for
a) Flow control b) Sequence c) Acknowledgement d) retransmission
Ans. (c)
15. In signed magnitude notation what is the minimum value that can be represented with 8 bits
(a) -128 (b) -255 (c) -127 (d) 0
Ans: a
17. When an array is passed as parameter to a function, which of the following statement is correct
a) The function can change values in the original array
b) In C parameters are passed by value. The function cannot change the original value in the array
c) It results in compilation error when the function tries to access the elements in the array
d) Results in a run time error when the function tries to access the elements in the array
Ans: a
18. The type of the controlling statement of a switch statement cannot be of the type
a) int b) char c) short d) float e) none
Ans: d
19. What is the value of the statement (3^6) + (a^a)?
a) 3 b) 5 c) 6 d) a+18 e) None
Ans: b
20. Consider the following program:
# include
class x {
public:
int a;
x();
};
x::x() { a=10; cout<
class b:public x {
public:
b();
};
b::b() { a=20; cout<
main ()
{ b temp;
}
 What will be the output of this program?
a) 10 b) 20 c) 2010 d) 1020
Ans: b

C Programming Interview Questions Part Seven

C Programming Interview Questions with answers, interview questions and answers, c programming interview question part seven.learn c programming online, c programs, online c questions
 

<< Prev      1      2      3      4      5      6      7     


Part 7

100)

void main()
{
int i;
char a[]="\0";
if(printf("%s\n",a))
printf("Ok here \n");
else
printf("Forget it\n");
}

Answer:

Ok here

Explanation:

Printf will return how many characters does it print. Hence
printing a null character returns 1 which makes the if
statement true, thus "Ok here" is printed.




101)
 void main()
{
void *v;
 Page 32 6/26/2004
32
int integer=2;
int *i=&integer;
v=i;
printf("%d",(int*)*v);
}

Answer:

Compiler Error. We cannot apply indirection on type void*.

Explanation:

Void pointer is a generic pointer type. No pointer arithmetic can
be done on it. Void pointers are normally used for,
1. Passing generic pointers to functions and returning such
pointers.

2. As a intermediate pointer type.
3. Used when the exact pointer type will be known at a later
point of time.



102)
 void main()
{
int i=i++,j=j++,k=k++;
printf(“%d%d%d”,i,j,k);
}

Answer:

Garbage values.

Explanation:

An identifier is available to use in program code from the point of
its declaration.
So expressions such as i = i++ are valid statements. The i, j and k
are automatic variables and so they contain some garbage value.
Garbage in is garbage out (GIGO).




103)
 void main()
{
static int i=i++, j=j++, k=k++;
printf(“i = %d j = %d k = %d”, i, j, k);
}

Answer:

i = 1 j = 1 k = 1

Explanation:

Since static variables are initialized to zero by default.

104) void main()
{
while(1){
if(printf("%d",printf("%d")))
break;
else
continue;
}
}

Answer:

Garbage values

Explanation:

The inner printf executes first to print some garbage value. The
printf returns no of characters printed and this value also cannot be
predicted. Still the outer printf prints something and so returns a
non-zero value. So it encounters the break statement and comes
out of the while statement.



104) main()
{
unsigned int i=10;
while(i-->=0)
printf("%u ",i);
}

Answer:

10 9 8 7 6 5 4 3 2 1 0 65535 65534…..

Explanation:

Since i is an unsigned integer it can never become negative. So the
expression i-- >=0 will always be true, leading to an infinite loop.




105) #include<conio.h>
main()
{
int x,y=2,z,a;
if(x=y%2) z=2;
a=2;
printf("%d %d ",z,x);
}

Answer:

Garbage-value 0

Explanation:

The value of y%2 is 0. This value is assigned to x. The condition
reduces to if (x) or in other words if(0) and so z goes uninitialized.
Thumb Rule: Check all control paths to write bug free code.



106) main()
{
int a[10];
printf("%d",*a+1-*a+3);
}

Answer:

4

Explanation:

*a and -*a cancels out. The result is as simple as 1 + 3 = 4 !



107) #define prod(a,b) a*b
main()
{
int x=3,y=4;
printf("%d",prod(x+2,y-1));
}

Answer:

10


Explanation:

The macro expands and evaluates to as:
x+2*y-1 => x+(2*y)-1 => 10



108) main()
{
unsigned int i=65000;
while(i++!=0);
printf("%d",i);
}

Answer:

1

Explanation:

Note the semicolon after the while statement. When the value of i
becomes 0 it comes out of while loop. Due to post-increment on i
the value of i while printing is 1.




109) main()
{
int i=0;
while(+(+i--)!=0)
i-=i++;
printf("%d",i);
}

Answer:

-1

Explanation:

Unary + is the only dummy operator in C. So it has no effect on
the expression and now the while loop is, while(i--!=0) which is
false and so breaks out of while loop. The value –1 is printed due
to the post-decrement operator.




113) main()
{
float f=5,g=10;
enum{i=10,j=20,k=50};
printf("%d\n",++k);
printf("%f\n",f<<2);
printf("%lf\n",f%g);
printf("%lf\n",fmod(f,g));
}

Answer:

Line no 5: Error: Lvalue required
Line no 6: Cannot apply leftshift to float
Line no 7: Cannot apply mod to float

Explanation:

Enumeration constants cannot be modified, so you cannot apply
++.
Bit-wise operators and % operators cannot be applied on float
values.
fmod() is to find the modulus values for floats as % operator is for
ints.




110) main()
{
int i=10;
void pascal f(int,int,int);
f(i++,i++,i++);
printf(" %d",i);
}
void pascal f(integer :i,integer:j,integer :k)
{
write(i,j,k);
}

Answer:

Compiler error: unknown type integer
Compiler error: undeclared function write

Explanation:

Pascal keyword doesn’t mean that pascal code can be used. It
means that the function follows Pascal argument passing mechanism in
calling the functions.




111) void pascal f(int i,int j,int k)
{
printf(“%d %d %d”,i, j, k);
}
void cdecl f(int i,int j,int k)
{
printf(“%d %d %d”,i, j, k);
}
main()
{
int i=10;
f(i++,i++,i++);
printf(" %d\n",i);
i=10;
f(i++,i++,i++);
printf(" %d",i);
}

Answer:

10 11 12 13
12 11 10 13

Explanation:

Pascal argument passing mechanism forces the arguments to be
called from left to right. cdecl is the normal C argument passing
mechanism where the arguments are passed from right to left.




112). What is the output of the program given below
main()
{
signed char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
}

Answer:

-128

Explanation:

Notice the semicolon at the end of the for loop. THe initial
value of the i is set to 0. The inner loop executes to
increment the value from 0 to 127 (the positive range of
char) and then it rotates to the negative value of -128. The
condition in the for loop fails and so comes out of the for
loop. It prints the current value of i that is -128.




113) main()
{
unsigned char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
}

Answer

infinite loop

Explanation

The difference between the previous question and this one is that
the char is declared to be unsigned. So the i++ can never yield negative
value and i>=0 never becomes false so that it can come out of the for
loop.




114) main()
{
char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
}

Answer:

Behavior is implementation dependent.

Explanation:

The detail if the char is signed/unsigned by default is
implementation dependent. If the implementation treats the char
to be signed by default the program will print –128 and terminate.
On the other hand if it considers char to be unsigned by default, it
goes to infinite loop.

Rule:

You can write programs that have implementation
dependent behavior. But dont write programs that depend on such
behavior.




115) Is the following statement a declaration/definition. Find what does it
mean?
int (*x)[10];

Answer

Definition.

x is a pointer to array of(size 10) integers.
Apply clock-wise rule to find the meaning of this definition.




116). What is the output for the program given below
typedef enum errorType{warning, error, exception,}error;
main()
{
error g1;
g1=1;
printf("%d",g1);
}

Answer

Compiler error: Multiple declaration for error

Explanation

The name error is used in the two meanings. One means
that it is a enumerator constant with value 1. The another use is
that it is a type name (due to typedef) for enum errorType. Given a
situation the compiler cannot distinguish the meaning of error to
know in what sense the error is used:
error g1;
g1=error;
// which error it refers in each case?
When the compiler can distinguish between usages then it
will not issue error (in pure technical terms, names can only be
overloaded in different namespaces).

Note: the extra comma in the declaration,
enum errorType{warning, error, exception,}
is not an error. An extra comma is valid and is provided just for
programmer’s convenience.




117) typedef struct error{int warning, error,
exception;}error;
main()
{
error g1;
g1.error =1;
printf("%d",g1.error);
}

Answer

1

Explanation

The three usages of name errors can be distinguishable by the
compiler at any instance, so valid (they are in different namespaces).
Typedef struct error{int warning, error, exception;}error;
This error can be used only by preceding the error by struct kayword as
in:
struct error someError;
typedef struct error{int warning, error, exception;}error;
This can be used only after . (dot) or -> (arrow) operator preceded by the
variable name as in :
g1.error =1;
printf("%d",g1.error);
typedef struct error{int warning, error, exception;}error;
This can be used to define variables without using the preceding struct
keyword as in:
error g1;
Since the compiler can perfectly distinguish between these three usages, it
is perfectly legal and valid.

Note

This code is given here to just explain the concept behind. In real
programming don’t use such overloading of names. It reduces the
readability of the code. Possible doesn’t mean that we should use it!





118) #ifdef something
int some=0;
#endif
main()
{
int thing = 0;
printf("%d %d\n", some ,thing);
}

Answer:

Compiler error : undefined symbol some

Explanation:

This is a very simple example for conditional compilation.
The name something is not already known to the compiler
making the declaration
int some = 0;
effectively removed from the source code.




119) #if something == 0
int some=0;
#endif
main()
{
int thing = 0;
printf("%d %d\n", some ,thing);
}

Answer

0 0

Explanation

This code is to show that preprocessor expressions are not
the same as the ordinary expressions. If a name is not
known the preprocessor treats it to be equal to zero.





120). What is the output for the following program
main()
{
int arr2D[3][3];
printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0]))
);
}

Answer

1

Explanation

This is due to the close relation between the arrays and
pointers. N dimensional arrays are made up of (N-1)
dimensional arrays.
arr2D is made up of a 3 single arrays that contains 3
integers each .
The name arr2D refers to the beginning of all the 3 arrays.
*arr2D refers to the start of the first 1D array (of 3
integers) that is the same address as arr2D. So the
expression (arr2D == *arr2D) is true (1).
Similarly, *arr2D is nothing but *(arr2D + 0), adding a zero
doesn’t change the value/meaning. Again arr2D[0] is the
another way of telling *(arr2D + 0). So the expression
(*(arr2D + 0) == arr2D[0]) is true (1).
Since both parts of the expression evaluates to true the
result is true(1) and the same is printed.





121) void main()
{
if(~0 == (unsigned int)-1)
printf(“You can Answer this if you know how values are represented
in memory”);
}

Answer

You can answer this if you know how values are represented
in memory

Explanation

~ (tilde operator or bit-wise negation operator) operates on
0 to produce all ones to fill the space for an integer. –1 is
represented in unsigned value as all 1’s and so both are
equal.




122) int swap(int *a,int *b)
{
*a=*a+*b;*b=*a-*b;*a=*a-*b;
}
main()
{
int x=10,y=20;
swap(&x,&y);
arr2D
arr2D[1]
arr2D[2]
arr2D[3]
printf("x= %d y = %d\n",x,y);
}

Answer

x = 20 y = 10

Explanation

This is one way of swapping two values. Simple checking will help
understand this.




123) main()
{
char *p = “ayqm”;
printf(“%c”,++*(p++));
}

Answer:

b





124) main()
{
int i=5;
printf("%d",++i++);
}

Answer:

Compiler error: Lvalue required in function main

Explanation:

++i yields an rvalue. For postfix ++ to operate an lvalue is
required.




125) main()
{
char *p = “ayqm”;
char c;
c = ++*p++;
printf(“%c”,c);
}

Answer:

b

Explanation:


There is no difference between the expression ++*(p++)
and ++*p++. Parenthesis just works as a visual clue for the
reader to see which expression is first evaluated.





126)
int aaa() {printf(“Hi”);}
int bbb(){printf(“hello”);}
iny ccc(){printf(“bye”);}
main()
{
int ( * ptr[3]) ();
ptr[0] = aaa;
ptr[1] = bbb;
ptr[2] =ccc;
ptr[2]();
}

Answer:

bye

Explanation:

int (* ptr[3])() says that ptr is an array of pointers to functions
that takes no arguments and returns the type int. By the
assignment ptr[0] = aaa; it means that the first function pointer in
the array is initialized with the address of the function aaa.
Similarly, the other two array elements also get initialized with the
addresses of the functions bbb and ccc. Since ptr[2] contains the
address of the function ccc, the call to the function ptr[2]() is same
as calling ccc(). So it results in printing "bye".






127)
main()
{
int i=5;
printf(“%d”,i=++i ==6);
}

Answer:

1

Explanation:

The expression can be treated as i = (++i==6), because == is of
higher precedence than = operator. In the inner expression, ++i is
equal to 6 yielding true(1). Hence the result.





128) main()
{
char p[ ]="%d\n";
p[1] = 'c';
printf(p,65);
}

Answer:

A

Explanation:

Due to the assignment p[1] = ‘c’ the string becomes, “%c\n”.
Since this string becomes the format string for printf and ASCII
value of 65 is ‘A’, the same gets printed.





129) void ( * abc( int, void ( *def) () ) ) ();

Answer::

abc is a ptr to a function which takes 2 parameters .(a). an
integer variable.(b). a ptrto a funtion which returns void. the
return type of the function is void.

Explanation:

Apply the clock-wise rule to find the result.




130) main()
{
while (strcmp(“some”,”some\0”))
printf(“Strings are not equal\n”);
}

Answer:

No output

Explanation:

Ending the string constant with \0 explicitly makes no difference.
So “some” and “some\0” are equivalent. So, strcmp returns 0
(false) hence breaking out of the while loop.






<< Prev      PART 1      PART 2      PART 3      PART 4      PART 5      PART 6      PART 7     






Popular Posts in this Weak