@Kumar: +1 @Kumar & Rajeshwar: ExitFailure is outputted because main is expected to return something which is not done in your case. Just add return 0; at the end of main to get expected output.
On Tue, Sep 13, 2011 at 11:33 PM, Ishan Aggarwal < ishan.aggarwal.1...@gmail.com> wrote: > int main() > {printf("%s",printf("samsung")+fun()); > return 0;}fun(){return "electronic";} > > > > > On Tue, Sep 13, 2011 at 11:28 PM, kumar raja <rajkumar.cs...@gmail.com>wrote: > >> main(){printf("%s",printf("samsung")+fun());}fun(){return "electronic";} >> >> The printf is a function which returns the number of printed characters , >> and scanf is a function >> which returns the number of inputs scanned . >> >> So after printing "samsung" it returns 7. fun() is returning a pointer to >> the constant string >> >> >> "electronic" , so it is like 7["electronic"] >> >> so the %s prints that string from the 7th index onwards till end . >> >> So output is "nic" >> >> so the total output is "samsungnic" >> >> >> but i dont know why it is exiting with some error code.. >> >> >> >> On 13 September 2011 10:51, Rajeshwar Patra <rajeshwarpa...@gmail.com>wrote: >> >>> http://codepad.org/erdnF74M >>> >>> can anyone explain the output ??? >>> >>> -- >>> *Rajeshwar Patra,* >>> *MCA final year,* >>> *Nit Durgapur* >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to algogeeks@googlegroups.com. >>> To unsubscribe from this group, send email to >>> algogeeks+unsubscr...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> >> >> -- >> Regards >> Kumar Raja >> M.Tech(SIT) >> IIT Kharagpur, >> 10it60...@iitkgp.ac.in >> 7797137043. >> 09491690115. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > > > -- > Kind Regards > Ishan Aggarwal > [image: Aricent Group] > Presidency Tower-A, M.G.Road,Sector-14 > Gurgaon,Haryana.122015 INDIA > Phone : +91-9654602663 > ishan2.aggar...@aricent.com <puneet.ar...@aricent.com> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.