Community Sites
Create your own community website and start earning today !
It's Free !
 
Communities Members BookmarksPolls Fresher Jobs Funny Pictures MCA Projects New Member FAQ  



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter


Posted By: Sree....       Member Level: Diamond       Posted Date: 20 Jul 2008       Category: Aptitude Test

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//



Select Answer:

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



      
Your Test Score: 0 / 0



Next Question: Output of the following program is main() {int i=0; for(i=0;i<20;i++) {switch(i) case 0:i+=5; case 1:i+=2; case 5:i+=5; default i+=4; break;} printf("%d,",i); } }
Previous Question: In the following code segment what will be the result of the function, value of x , value of y {unsigned int x=-1; int y; y = ~0; if(x == y) printf("same"); else printf("not same"); }
Related Questions:
  • A software engineer has the capability of thinking 100 lines of code in five minutes and can type 100 lines of code in 10 minutes. He takes a break for five minutes after every ten minutes. How many lines of codes will he complete typing after an hour?


  • Numbers


  • Veeru says to Jay, "Can you figure out how many Eggs I have in my bucket?" He gives 3 clues to Jay: If the number of Eggs I have 1. is a multiple of 5, it is a number between 1 and 19 2. is not a multiple of 8, it is a number between 20 and 29 3. is not a multiple of 10, it is a number between 30 and 39 How many Eggs does Veeru have in his bucket?


  • What is the output of the following program? main() { int l=6; switch(l) { default : l+=2; case 4: l=4; case 5: l++; break; } printf("%d",l); }


  • Find the odd man out:


  • Categories

    Aptitude Test Arithmetic Reasoning General Knowledge - India 
    General Knowledge Computer Basics Physics 
    Mathematics Biology Chemistry 
    English Botany Anatomy 
    Physiology Biochemistry Pharmacology 
    Community medicine Forensic medicine Microbiology 
    Pathology Paediatrics Ophthalmology 
    ENT Obstretics and Gynaecology Surgery 
    Medicine 

    Submit Interview/Test Questions with Answers and make money from adsense revenue sharing program

    Want to prepare for an interview? Try our aptitude tests and standard interview questions first.
    Watch TV Channels



    Contact Us    Editors    Privacy Policy    Terms Of Use   

    SpiderWorks Technologies Pvt Ltd. 2006 - 2007 All Rights Reserved.