GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Placement Papers  >  Honey Well  >  C
Next Question 
 C  |  Question 1 of 5    Print  
Honey Well Written Test -  C Questions

I did not attempted the C paper but still I just had a look on C and java paper.  in C most of the question were programs and their out was  asked in LINUX environment.

1)
      int main()
      {
      char *a= "Novell";
      char  *b;
      b=malloc(10*sizeof(char));
      memset(b,0,10);
      while(*b++=*a++);
      printf("%s",b);
      return 0;
      }
2) int main()
     {
     printf("Hello");
     fork();
     printf("World");
     }




  
Total Answers and Comments: 2 Last Update: June 04, 2006   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
March 29, 2006 05:56:18   #1  
gopi_ra Member Since: November 2005   Contribution: 3    

RE: Honey Well Written Test -  C Question...

1. output is Novell

2. output is Hello World World

because after 1st printf fork is executed .This creates the child process so child will execute 2nd printf & oncemore  by parent process.Hence world is printed twice.


 
Is this answer useful? Yes | No
June 04, 2006 02:48:14   #2  
ramubeedhimane        

RE: Honey Well Written Test -  C Question...

for 2nd question,

o/p - helloworldhelloworld. ( this is the case on linux)

because, execution of  first printf statment stores in buffer. 

fork , forks helloworld. thats why, its print 2 times helloworld.

In case if u placed "\n" line buffer in first printf .

like : printf("hello\n"); directly prints on standard buffer.

thats the reson it only forks the second printf.

o/p - hello

  world world 


 
Is this answer useful? Yes | No

 Related Questions

I did not attempted the C paper but still I just had a look on C and java paper.  in C most of the question were programs and their out was  asked in LINUX environment.1)      
Latest Answer : for 2nd question, o/p - helloworldhelloworld. ( this is the case on linux)because, execution of  first printf statment stores in buffer. fork , forks helloworld. thats why, its print 2 times helloworld.In case if u placed ...

1.what is the difference b/w pointer and pointer++2.what is difference b/w pointer &array3.what is the difference b/w class& structure 
Latest Answer : 3. structures and classes both are used in c++ but classes are private by default and structures are public by default. structures are also used in c but not classes. ...
Read Answers (2) | Asked by : ASHISH-KUMAR MISHRA


 Sponsored Links

 
Related Articles

Importance of Strong Vocabulary

Why Having a Strong Vocabulary is So Important In addition to your appearance and the way you carry yourself people will judge you based on the words that come out of your mouth Even if you are a mathematical genius having a poor vocabulary will send across a message that you re not very intelligent
 

HR Interview - Most Popular HR Interview Questions With Generic Answer Formats

Most Popular HR Interview Questions With Generic Answer Formats While it is impossible to know exactly what you will be asked during a job interview there are a number of generic questions that most companies will ask you mosgoogle In this article I will present you with some questions that are comm
 

HR Interview - How To Deal With Tricky Interview Questions

How To Deal With Tricky Interview Questions During your HR interview you will be presented with a number of questions from the interviewer The way you answer these questions will play a role in whether or not you re hired While some of these questions have obvious answers others will be tricky and t
 

How Leaders Can Build A Strong Team

How Leaders Can Build A Strong Team To be a great leader you will want to build a powerful team It doesn t matter how successful you are or plan to be To succeed you must know how to assemble the best people This is important whether you are a coach general or corporate executive mosgoogle The team
 

Questions You Should Be Prepared For During A Job Interview

Questions You Should Be Prepared For During A Job Interview While the way you answer questions during a job interview will only play a small role in whether or not you are hired it is important to pay attention to them Going to a job interview can be stressful especially if it is a highly competitiv
 

ASP.NET Interview Questions

Microsoft ASP NET Interview Questions This article provides Microsoft Interview Questions covering Microsoft ASP NET questions For more Interview Questions Answers related to Microsoft click on links provided at the end of each question set mosgoogle Microsoft ASP NET Interview Questions 1 What is R
 

C# Interview Questions

Microsoft C Interview Questions This article provides Microsoft Interview Questions covering Microsoft C questions For more Interview Questions Answers related to Microsoft click on links provided at the end of each question set mosgoogle Microsoft C Interview Questions 1 What is indexer Where it i
 

C Interview Questions

C Interview Questions This article provides C Interview Questions For more Interview Questions Answers related to C click on links provided at the end of each question set mosgoogle C Interview Questions 1 A switch statement cannot includea constants as arguments b constant expression as argumentsc
 

DB2 Interview Questions

DB2 Interview Questions This article provides Mainframe Interview Questions covering db2 questions For more Interview Questions Answers related to Mainframe click on links provided at the end of each question set mosgoogle 1 Loading of DB2 Unload with packed Decimal’ data to Oracle envi
 

Siebel Interview Questions

Siebel Interview Questions This article provides Siebel Interview Questions For more Interview Questions Answers related to Siebel click on links provided at the end of each question set mosgoogle Siebel Interview Questions 1 What is foreign key table in Siebel 2 Why do you need Primary in MVG 3 Whe
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape