Monday, September 24, 2012

TCS HR Interview Questions

After you have cleared your Written exam,HR interview plays an important role and one should try to make himself confident by making himself  very comfortable,one thing you should keep in your mind that they have came in order to select you not to reject you.Not only you want to have the job but they also want you as a employee.Some important questions they would ask and you must know.

thumbnail TCS HR Interview Questions

1. Strengths and Weakness or Positive and Ngative Points
Ans: You should know strengths and weakness.Don’t try to copy others Weakness and Strong points try to ask these questions to yourself and prepare these questions few days before from interview. And you should have real examples or try to make examples of your strengths and weakness. If you say you are a voracious reader then you should be capable of giving a related real life example where you can say you are a voracious reader.
2. What are your Hobbies ?
Ans: Don’t try to make fool of them,if you do so ,probably you may get catched by them if you are violating your previous spoken words.Always assert your real hobbies or that you actually do in free time. Because they will ask a lot of questions from your hobbies part.Like your hobbies include Cricket so they may ask you questions related to that not hard ones but general.So be prepare for that.
3. Extra co-curricular activities
Ans: Explain what you have done apart from your studies,it may be anything in which you feels your passion ,and you must have did something in that.
4. Tell me about yourself.
Ans: Tell them your Bio data which include all the information in the Bio data and be fluent while speaking about yourself.Because the one doesn’t know about himself or have hesitation in speaking about himself is of no use for them.
5. What experience do you have in this field?
Ans:If you are a fresher then you doesn’t have any experience then tell them about the project on which you have worked and about the training in company.
6. What do you know about this organization?
Ans: This is one of the most important question because you are going to join their organization and must know about them.You should search about TCS and know latest happenings, awards won by TCS and a little history of TCS. You can go to www.wikipedia.org for that information.
7. Are you a team player?
8. Why should we hire you?
Ans: In this part you should tell your strength and how their company is going to get benefit from it and you can use them in their firm so that company will get benefit from it.
9. What is your greatest strength?
10. Tell me about your dream job?
11. What is more important to you: the money or the work?
12. Are you willing to work overtime? Nights? Weekends?
13. Would you be willing to relocate if required?
14. Do you have any questions for TCS?
Ans: This is also one of the important question to answer at last of the interview so prepare yourself for such a question before going to interview. But questions about Payscale, working hours should not be asked which make them feel that your thinking is too narrow,cheap You can go for socialism if you like social services. And many other questions are there. But what is more important is, to ask a question because that shows your interest in company.Make yourself completely prepare for this question.
And try to get answers of these questions from yourself,ask yourself about these questions.

TCS PLACEMENT PAPER – maximize the chance to get placed in TCS

APTITUDE TEST :
1. The age of X and Y are in the ratio 5:6 and after 4 years their ratios are 7:8 then what is the present age of Y?
Ans. 12years 

2. In school there are some bicycles and 4wheeler wagons.one Tuesday there are 190 wheels in the campus.How many bicycles are there?
Ans. 15

3. Six friends go to juice corner there are 2 types of juices. And six different flavours are there they have to select 4 flavours from 16 flavours. In how many ways we can select?
Ans. 16C4

4. 3, 15, y, 51, 53,159,161. Find y
Ans. 17

5. 3 friends A, B, C went for week end party to McDonald’s restaurant and there they measure there weights in some order IN 7 rounds. A B C AB BC AC ABC. Final round measure is 155 kg then find the average weight of all the 7 rounds?
Ans. 4(155)/7=31

6. The cost of making car is divided into cost of material, cost of repairing and cost of painting in the ratio of 5:2:3. The cost used for material is 200. Find the total cost of making the car?
Ans. 400 

7. A triangle is made with the help of a rope. The sides of the triangle are X cm, Y cm and Z cm.Then what will be the area of the square made from the same rope?
Ans. ( (A+B+C)/4)2

8. What is the distance of the z-intercept from the x-intercept in the equation ax+by+cz=d (I do not remember the values of a, b, c, d).
Ans. sqrt ((d/a) 2+ (d/c) 2)

9. A scientist in Antarctic  region conducts research on bears came to know that bears changes according to the location .Once he moves 1 mile towards north, then he moves 2 miles towards east, then 1 mile towards south. Now the colour of bear he found will be
Ans. white
 10. A can copy 50 papers in 10 hours while both A & B can copy 70 papers in 10 hours. Then for how many hours required for B to copy 26 papers?
Ans.  13 

11. A boy bought a roll A of 56 inches wide and 141 yards long. He also bought B of 77 inches wide of length 333yards. We don’t want any details of B. Some irrelevant matter. Final question is Time taken for cutting A into 1 yard piece is 2 seconds. Time taken to cut into 141 pieces of 1 yard each is?
Ans. is 2(140) =280

12. Person buys a horse for 15 ponds, after one year he sells it for 20 pounds. After one year, again he buys the same horse at 30 pounds and sells it for 40 pounds. What is the profit for that person?
Ans. is 15 pounds

13. There are 1000 pillars for a temple. 3 friends Linda, Chelsey, Juli visited that temple. (Some unrelated stuff).Linda is taller than Chelsea and taller than 2 of 1000 pillars. Julia is shorter than Linda. Find the correct sentence?
(a) Linda is shorter among them
(b) Chelsea is taller than Julia
(c) Chelsea is shorter than Julia
(d) Cannot determine who is taller among Chelsea and Julia
Ans. (d)

14. In a family there are some boys and girls. All boys told that they are having equal no of brothers and sisters
and girls told that they are having twice the no. of brothers than sisters. How many boys and girls present in a
family?
Ans. 4 boys and 3 girls

15. Ram buys a cycle for 31 dollars and given a cheque of amount 35 dollars. Shop Keeper exchanged the cheque with his neighbor and gave change to Ram. After 2 days, it is known that cheque is bounced. Shop keeper the amount to his neighbor. The cost price of cycle is 19 dollars. What is the profit/loss for shop keeper?
Ans. is 23(cost price + change given).

16. Metal strip of width ‘x’ cm. 2 metal strips are placed one over the other, then the combine length of 2 strips is ‘y’. If ‘z’ strips are placed in that manner.What is the final width of that arrangement?
Ans. is (z-1) (y-x) +x.

17. A game is played between 2 players and one player is declared as winner. All the winners from first round are played in second round. All the winners from second round are played in third round and so on. If 8 rounds are played to declare only one player as winner, how many players are played in first round.
Ans. is 28.

18. There are 3 boys A, B, C and 2 Girls D, E. D always sit right to A. Girls never sit in extreme positions and in the middle position. C always sits in the extreme positions. Who is sitting immediate right to E?
Ans. is B or C

19. There are two water tanks A and B, A is much smaller than B. While water fills at the rate of 1 liter every hour in A, it gets filled up like, 10, 20, 40, 80, 160 in tank B. (At the end of first hour, B has 10 liters, second hour it has 20 liters and so on). If tank B is 1/32 filled of the 21 hours, what is total duration of hours required to fill it completely?
a) 26        B) 25     c) 5       d) 27
Ans:26

20. Entry ticket to an exhibition ranges from 1p to 31p. You need to provide exact change at the counter. You have 31p coin. In how many parts will u divide 31p so that u will provide the exact change required and carry as less coins as possible?
(a) 22
(b) 31
(c) 6
(d) 32
Ans. is 6

21. There are 2 friends Peter and Paul. Peter age is twice as old as Paul when peter was as old as Paul is now. Sum of the present ages of Peter and Paul is 35.What is the present age of Peter?
Ans. is 20

23. Two bowls are taken, one contains water and another contains tea. One spoon of water is added to second bowl and mixed well, and a spoon of mixture is taken from second bowl and added to the second bowl. Which statement will hold good for the above?
Ans. second liquid in first bowl is smaller than the first mixture in second bowl)

24. Rearrange and categorize the word ‘IGTRE’?
Ans. Animal (TIGER)

25. One grandfather has three grandchildren, two of their age difference is 3, eldest child age is 3 times youngest child’s age and eldest child’s age is two times of sum of other two children. What is the age of eldest child?
Ans. 18

26. The ticket for a journey is in the range of 1 to 63 paise. You have 63 paise in your pocket and so on. and the question is You have to change the money into coins and all denominations are available at final. You have to buy the ticket and you should have at least one coin?
Ans. 64 (Just add 1 to highest i.e. 63+1)

27. The sum of two numbers is given and product is also given find the square of difference of two numbers..
Ans. (a-b)2=a2+b2+2ab.

28. The dog and here are running, dog crosses the roads, rivers and different. Here start running after 2 hours of dog running, dog runs 30kmph in 6 hours then what is the average speed of here?(values are not same)
Ans. 30*6/4

30. A water tank is filled in the way as 256,128,64,… th parts in every hour, then in how many hours the tank will filled?
Ans. 256,128,64,32,16,8,4,2,1 ( 9 hours)

31. The age of Ram and Sayam are in the ratio 5:6 and after 4 years their ratios are 7:8 then what is the present age of Sayam?
Ans. 12years

 32. There are two water tanks A and B, A is much smaller than B. While water fills at the rate of 1 liter every hour in A, it gets filled up like, 10, 20, 40,80, 160…..in tank B. 1/8 th of the tank B is filled in 22 hours. What is the time to fill the tank fully?
a) 26
(b) 25
(c) 5
(d) 27
Ans: 22+log 2 base 8=22+4=26

33. A sheet of paper has statements numbered from 1 to 70. For all values of n from 1 to 70. Statement n says ‘At least n of the statements on this sheet are false.’ Which statements are true and which are false?
(a) The even numbered statements are true and the odd numbered are false.
(b) The odd numbered statements are true and the even numbered are false.
(c) The first 35 statements are true and the last 35 are false.
(d) The first 35 statements are false and the last 35 are false.
Ans. c
34. A lady has fine gloves and hats in her closet- 18 blue- 32 red , 10 white , 25 yellow, 55 purple, 30 orange. The lights are out and it is totally dark in spite of the darkness. She can make out the difference between a hat and a glove. She takes out an item out of the closet only if she is sure that if it is a glove. How many gloves must she take out to make sure she has a pair of each color of blue, red, yellow?
(a) 59
(b) 8
(c) 50
(d) 42
Ans: a(32+25+2)
Note: For this type of questions:
Bigger+Middle+1 (Suppose 18, 32, 25 =32+25+1), If you do not find answer in options, choose the one closer those the answer you got.

35. The IT giant Tirnop has recently crossed a head count of 150000 and earnings of $7 billion. As one of the fore runners in the technology front, Tirnop continues to lead the way in products and services in India. At Tirnop, all
programmers are equal in everyrespect. They receive identical salaries and also write code at the same rate. Suppose 12 such programmers take 12 minutes to write 12 lines of code in total. How long will it take 72 programmers to write 72 lines of code in total?
For this type question you should follow d step of basic math that will helpful you get enough time from that.
12 prog 12 line 12 min
1 prog 12 line 12*12
1 1 12*12/12
72 1 12*12/(12*72)
72 72 12*12*72/(12*72)
Ans:12

36. 12 people {a1, a2, …, a12} meet and shake hands in a circular fashion. In other words, there are totally 36 handshakes involving the pairs, {a1, a2}, {a2, a3}, …, {a11, a12}, {a12, a1}. Then size of the smallest set of people such that the rest have shaken hands with at least one person in the set is
(a) 12
(b) 4
(c) 18
(d) 11
Ans. B (N/3)

37. 10 suspects are rounded by the police and questioned about a bank robbery. Only one of them is guilty. The suspects are made to stand in a line and each person declares that the person next to him on his right is guilty. The rightmost person is not questioned. Which of the following possibilities are true?
A. All suspects are lying.
B. leftmost suspect is innocent.
C. leftmost suspect is guilty
(a) A only
(b) A or C
(c) A or B
(d) B only
Ans. c

38. Alok and Bhanu play the following min-max game. Given the expression N = 15 + X*(Y – Z) Where X, Y and Z are variables representing single digits (0 to 9), Alok would like to maximize N while Bhanu would like to minimize it. Towards this end, Alok chooses a single digit number and Bhanu substitutes this for a variable of her choice (X, Y or Z). Alok then chooses the next value and Bhanu, the variable to substitute the value. Finally Alok proposes the value for the remaining variable. Assuming both play to their optimal strategies, the value of N at the end of the game would be?
Ans. 15+18 =33
Note: For this type of questions:
x+y-z=11
x-y-z=2
x*(y+z)=18

TCS Technical Interview Questions For CSE And ECE Students

power by 2x2 TCS Technical Interview Questions For CSE And ECE Students
thumbnail1 TCS Technical Interview Questions For CSE And ECE Students 
Technical Interview Questions:

•What is static variable?
•What does a pointer mean?
•What is a structure?
•What are the differences between structures and arrays?
•In header files whether functions are declared or defined?
•What are the differences between malloc() and calloc()?
•What are macros? what are its advantages and disadvantages?
•Difference between pass by reference and pass by value?
•What is static identifier?
•Where are the auto variables stored?
•Where does global, static, local, register variables, free memory and C Program instructions get stored?
•Difference between arrays and linked list?
•What are enumerations?
•What is a class?
•What is an object?
•What is the difference between an object and a class?
•What is the difference between class and structure?
•What is public, protected, private?
•What are virtual functions?
•What is friend function?
•What is a scope resolution operator?
•What do you mean by inheritance?
•What is abstraction?
•What is a data structure?
•What does abstract data type means?
•Evaluate the following prefix expression ” ++ 26 + – 1324″ (Similar types can be asked)
•Convert the following infix expression to post fix notation ((a+2)*(b+4)) -1 (Similar types can be asked)
•How is it possible to insert different type of elements in stack?
•Stack can be described as a pointer. Explain.
•Write a Binary Search program
•What is the difference between an Abstract class and Interface?
•What is user defined exception?
•What do you know about the garbage collector?
•What is the difference between java and c++?
•In an HTML form I have a button which makes us to open another page in 15 seconds. How will you do that?
•What is the difference between process and threads?
•What is update method called?
•Have you ever used HashTable and Directory?
•What are statements in Java?
•What is RMI?
•Explain about RMI Architecture?
•What are Servelets?
•What is the use of servlets?
•Explain RMI Architecture?
•How will you pass values from HTML page to the servlet?
•How do you load an image in a Servelet?
•What is purpose of applet programming?
•How will you communicate between two applets?
•What are the basic functions of an operating system?
•Explain briefly about, processor, assembler, compiler, loader, linker and the functions executed by them.
•What are the difference phases of software development? Explain briefly?
•Differentiate between RAM and ROM?
•What is DRAM? In which form does it store data?
•What is cache memory?
•What is hard disk and what is its purpose?
•Differentiate between Complier and Interpreter?
•What are the different tasks of Lexical analysis?
•What are the different functions of Syntax phase, Scheduler?

thumbnail 31 TCS Technical Interview Questions For CSE And ECE StudentsIf you are a Electronics student some topics are suggested for you to be asked at the time of interview.Prepare the subject well but do not go so deep,but keep overview of all subjects.
  •  Digital electronics basic
  •  Diodes basic
  •  Terms like amplifier, IC, filter (only the basic information)
  • Some basics of C/C++
  •  Difference between 8085 and 8086
  • Communication basics
  •  How does 1G, 2G, 3G, GSM, CDMA etc just basics
  •  What is OSI layer model
  •  What is LAN, WAN, MAN
  •  Tell about Router and Topologies, TCP/IP model.

Some questions asked to Electronics Students during Technical Interview at Campus Recruitment in Jabalpur – 2011:
  • What is MOSFET
  • What is LCS
  • What is LED TV
  • Differentiate between LCD,LED and PLASMA.
  • Explain working of an LCD and PLASMA TV.
  • Draw the diagram of MOSFET
  • What is norton’s theorem
  • What is mobile communication
  • Working of keypad in a mobile unit
  • Call-generation through a mobile
  • In a mobile how does * and # works or what is its use
  • Explain LED.
  • What is MATLAB
Some things needs to be keep while interviewing is that you are confident while replying ,if not pretend to do so, you will feel yourself in confidence.And English is not only necessary but is must.

Saturday, September 22, 2012

Health & Family Welfare Department (Govt of Delhi)

Medical OfficersDate of posting:21 September

Eligibility: MBBS
Location: Delhi
Job Category: Govt Sector, Others
Last Date: 5 October 12
Job Type: Full Time
Hiring Process: Written-test.
Job Details
Health & Family Welfare Department (Govt of Delhi), inviting application for the post of Medical Officers
www.freshersworld.com

Post Name Qualification No of Post
Medical Officer
1. A recognized MBBS Qualification included in the First or Second Schedule or Part-II of the Third Schedule (other than licentiate qualifications) to the Indian Medical Council Act, 1956. Holders of educational qualification included in part- II of the Third Schedule should also fulfill the conditions stipulated in sub-section (3) of Section 13 of the Indian Medical Council Act, 1956.
Total:250(UR 128,SC 37,ST 18,OBC 67,PH 08)
Completion of compulsory rotating internship: Candidates who may not have completed rotating internship shall be eligible to appear for the written examination provided that, if selected, they shall have satisfactorily completed the compulsory internship before appointment as contained in DHS Rules, 2009.The candidate must be registered with Delhi Medical Council before appointment to the Post. The essential educational qualification shall be as per subsisting DHS, Rules,2009.
Age Limit: 32 years

Pay Scale : Rs.53000

Mode of Selection: There shall only be a written examination. This written examination shall be organized by the Dean, Maulana Azad Medical College, New Delhi.
Application Fee: Applications may also be enclosed with a demand draft of Rs. 1500/- in favor of Dean, MAMC payable at New Delhi. However, applicants of reserved category belonging to SC/ST, the demand draft payable is only Rs. 750.



How to apply
The applications in the prescribed format along with certified copies of educational qualification and experience may reach Dean, Maulana Azad Medical College, 2-Bahadur Shah Zafar Marg, New Delhi-2 by 05.10.2012 up to 4:00 p.m.www.freshersworld.com

Click Here For Details

Click Here to Practice Free Sample Placement Papers of IT, PSU and Banks (IBPS)

Submit Your Resume Here & Get Noticed by Top Companies Recruiters



Company Profile

Government Of National Capital Territory Of Delhi, Health & Family Welfare Department, 9th Level, A-Wing, Delhi Secretariat, Lp.Estate, New Delhi-2

Wednesday, September 19, 2012

NALCO

Eligibility: BE/B.Tech(Chemical Engineering, Civil Engineering, Electrical & Electronics Engineering (EEE), Instrumentation & Control Engineering, Mechanical Engineering, Metallurgical /Materials Engineering, Mineral / Mining Engineering, Electrical Engineering)
Location: Bhubaneshwar
Job Category: Core Technical, Govt Sector, Others
Last Date: 30 September 12   Job Type: Full Time Hiring Process: Written-test.
Job Details
NALCO hiring Engineers
Advt. No: 10120301
NALCO is looking for committed, promising and passionate young Graduate Engineers having only full time regular courses from recognised institute/university to be inducted during 2013 in the disciplines of Mechanical, Electrical, Instrumentation,  Metallurgy, Civil, Chemical, Electronics, Geology and Mining through GATE-2013 www.freshersworld.com
Post NameQualificationNo. of Post
Graduate Engineers
Graduate Engineers having only full time regular courses from recognised institute/university to be inducted during 2013 in the disciplines of Mechanical, Electrical, Instrumentation,  Metallurgy, Civil, Chemical, Electronics, Geology and Mining through GATE-2013
61
Selection Process : The eligible candidates those who are interested to apply for the above disciplines in NALCO needs to appear in GATE-2013 examination as per the instruction and timelines notified by GATE-2013 and in one of the following GATE-2013 examination papers. 
Sl. No. GATE-2013 Paper Code 
1.  Mechanical Engineering ME
2.  Electrical Engineering EE
3. Instrumentation Engineering  IN
4.  Metallurgical Engineering MT
5.  Civil Engineering CE
6.  Chemical Engineering CH
7.  Electronics Engineering EC
8.  Geology GG
9.  Mining Engineering MN


How to apply
Interested candidates should apply online. www.freshersworld.com
Important Dates : 
Commencement of Online submission GATE application for GATE-201301.09.2012
Last date for Online submission of GATE Application 30.09.2012
Last date for receipt of hard copy of Online GATE application at respective GATE Offices.08.10.2012
GATE Examination 10.02.2013
5 Announcement of GATE Results15.03.2013

Click Here For Details


Apply Online

Click Here to Practice Free Sample Placement Papers of IT, PSU and Banks (IBPS)

Submit Your Resume Here & Get Noticed by Top Companies Recruiters

Company Profile
National Aluminium Company Ltd. (NALCO), is considered to be a turning point in the history of Indian Aluminium Industry. In a major leap forward, Nalco has not only addressed the need for self-sufficiency in aluminium, but also given the country a technological edge in producing this strategic metal to the best of world standards. Nalco was incorporated in 1981 in the Public Sector, to exploit a part of the large deposits of bauxite discovered in the East Coast.

National Institute of Electronics and Information Technology Walk-In

Quality AnalystDate of posting:18 September
Eligibility: Other Courses
Location: Rajasthan-other
Job Category: Govt Sector, Others, Walkin
Last Date: 19 September 12
Job Type: Full Time
Hiring Process: Walk - In.
Job Details

National Institute of Electronics and Information Technology, conduct walk-in interview for the post of Quality Analyst
(Demographic)
www.freshersworld.com
Post Name Qualification No of Post
Quality Analyst10+2 with good knowledge of computers, English & Hindi
50

Pay Scale: Rs 7500

Application Fee: Non -refundable registration fee of Rs 350/-to be deposited in the form of Demand  draft only in favour of NELIT , Chandigarh payable at Chandigarh.



How to apply
Interested candidates may come with their resume and a latest photograph along with original tstimonials and their attested photocopies and non -refundable registration fee of Rs 350. Venue of Interview: NPR Data Entry Centre , Hanumaneshwar Mandir , Ist Floor , Near Maheshwari Public School, Vaishali Nagar, Ajmer 305 001 Rajastan.The Interview will be held at 19 th & 20 th Sept 2012  from 10.00 am to 4.00 pm.www.freshersworld.com 
Click Here For Details
To Download Application Form

Click Here to Practice Free Sample Placement Papers of IT, PSU and Banks (IBPS)   

Submit Your Resume Here & Get Noticed by Top Companies Recruiters

Company Profile
Dr.A.K.D.DWIVEDI (Director) ,S.C.O. 114 - 116, Sector 17 - B Chandigarh - 160 017 ( India )Head Quarter :  DOEACC Society, Chandigarh Centre

DELHI DEVELOPMENT AUTHORITY AE REQUIRTMENT 2013


DELHI DEVELOPMENT AUTHORITY (DDA)
Personnel Branch-I, Vikas Sadan, INA, New Delhi - 110023.




Tuesday, September 18, 2012

C programming questions and answers

 INTERVIEW C QUESTIONS

 
(1)What will be output of following c program?

#include<stdio.h>
void main(){
char far *p=(char far *)0x55550005;
char far *q=(char far *)0x53332225;
*p=25;
(*p)++;
printf("%d",*q);
}

Output: 26
Explanation:

Far address of p and q are representing same physical address. Physical address of 0x55550005 = 0x5555*ox10 + ox0005 = 0x55555 Physical address of 0x53332225 = 0x5333 * 0x10 + ox2225 = 0x55555

*p =25, means content at memory location 0x55555 is assigning value 25

(*p)++ means increase the content by one at memory location 0x5555 so now content at memory location 0x55555 is 26
*q also means content at memory location 0x55555 which is 26

(2) What will be output of following c program?

#include<stdio.h>
void main(){
char i=13;
while(i){
i++;
}
printf("%d",i);
}

Output: 0
Explanation:
while(i) will true if i non negative. while(i) will false only when i=0. Since i is char type of data which is cyclic in nature.

i will get maximum value to 127 the minimum value -128 then it will be zero .When i=0 ,while condition will false and i will come outside the loop and at that time value of I is zero.

(3) Write a c program without using == operator compare two numbers?
Answer:

#include<stdio.h>
void main(){
int a=5,b=5;
if(b^a)
printf("EQUAL”);
}

Output: EQUAL

(4) What will be output of following c program?

#include<stdio.h>
void main(){
char a='\x82';
printf("%d",a);
}

Output:-126

Explanation:
\x symbol indicate the hexadecimal number system in character constant. So 82 is hexadecimal number its equivalent binary value is 130. 130 is beyond the range of signed char. Since signed char is cyclic in nature so its value will be
130-256=-126
(5) What will be output of following c program?

#include<stdio.h>
void main(){
enum {a,b=32766,c,d,e=0};
printf("%d",a);
}

Output: error
Explanation:
Value of enum constant must be within range of signed int .Maximum value of signed int is 32767 while value of d=32768

(6) What will be output of following c program?

#include<stdio.h>
#define char double
void main(){
char a=9;
printf("%d",sizeof(a));
}

Output: 8

Explanation:
#define is preprocessor directive which process before the actual compilation. #define paste value in the in place of macro in the program before actual compilation. New source code will be:

#include<stdio.h>
void main(){
double a=9;
printf("%d",sizeof(a));
}

Now a is double type of data which size is 8 byte.

(7)How you will copy the content of one array to another in another array by one line statement?
Answer:

#include<stdio.h>
void main(){
int i;
struct arr1{
int a[8];
} ;
struct arr1 p={1,2,3,4,5,6,7,8},q;
q=p; //copy in one line
for(i=0;i<8;i++){
printf("%d",q.a[i]);
}
}

Output: 12345678

(8) What will be output of following c program?

#include<stdio.h>
void main() {
char arr[8]={'S','A','V','R','I','Y','A'};
char *p;
p=(char *)(arr+2)[2];
printf("%c",p);  
}

Output: I

(9) What will be output of following c program?

#include<stdio.h>
void main() {
float a=5e4;
printf("%f",a);
}

Output: 50000.000000
Explanation:
5e4 is in exponential form is (5*10^4)

(10) What will be output of following c program?

#include<stdio.h>
void main(){
float a=5e40;
printf("%f",a);
}

Output: +INF
Explanation:
5e40 is beyond the range of float so output is plus infinity.

(11) What will be output of following c program?

#include<stdio.h>
int * operation(int,int);
void main() {
int p=6,q=9,*r;
r=operation (p,q);
printf("%d",*r);
}
int * operation(int p,int q) {
int a=1,b; b=!(p)+ a * q++;
return &b;
}

Output: garbage
Explanation:

Variable b is auto type. Its scope is within the operation function. When control will transfer to the operation function b will die. We are returning address of variable b to r. *r means content at location control will transfer to the operation function b will die. We are returning address of variable b to r. When control transfer to main function assigning the address of b till now variable b has dead and r will store some garbage value.*r means content at location &r so it will show wrong output. To find write output declare b as static data type. Scope of static data type is entire the program.

#include<stdio.h>
int * operation(int,int);
void main(){
int p=6,q=9,*r;
r=operation(p,q);
printf("%d",*r);
}
int * operation(int p,int q){
int a=1;
static int=b;
b=!(p)+ a * q++;
return &b;
}

Output: 9

(12) What will be output of following c program?

#include<stdio.h>
void main() {
extern int p;
printf("%d",p);
}
int p=34;

Output: 34
Explanation:
extern storage class search the value of p in outside the function.

(13) What will be output of following c program?

#include<stdio.h>
void main() {
extern int p=23;
printf("%d",p);
}

Output: Compilation error
Explanation:
Extern variable cannot be initialized due to for extern variable has not any storage space.

#include<stdio.h>
void main() {
extern int p;
printf("%d",p);
}
int p;

Output: 0
Explanation:
Default value of extern data type is zero.

(14) What will be output of following c program?

#include<stdio.h>
void main(){
int p;
p= 4>7 ? return 5:return 6;
printf("%d",p);
}

Output: Compilation error

Explanation:
We cannot use return keyword in conditional operator.

(15) What will be output of following c program?

#include<stdio.h>
void main(){
int p=0;
p= 4>7 ? p=11:p=22;
printf("%d",p);
}

Output: error
Explanation:
Assignment operator = has less precedence than conditional operator. Condition 4>7 is false .So false i.e. p=12 will execute but since = has less precedence so first value of p will assign 0 because initial value of p is. Now statement is
0=22
We cannot assign a value to constant. So error will Lvalue required. To solve such problem use () operator it has higher precedence than conditional operator.

(16) What will be output of following c program?

#include<stdio.h>
void main(){
int p=0;
p= 4>7 ? (p=11):(p=22);
printf("%d",p);
}

Output: 22

(17) What will be output of following c program?

#include<stdio.h>
void main(){
int p=0;
p= 11>7 ? (p=11):p=22;
printf("%d",p);
}

Output: 11
Explanation:
Condition operator evaluates only true part 11>7 is true. So it will assign 11 to p .It doesn’t check p=22 is write or wrong. It only checks its syntax is correct or not.



MORE QUESTION AT  PLEASE COMMENT TOPIC