Re: [algogeeks] Adobe Interview Question

2012-12-11 Thread saurabh singh
I would have replied back with I am doing it with C programming language only. the read function that we use is not an actual system call. It is a *wrapper to a system call*. Any other function that we use usually ends up in calling some system call. The actual system call is called by low level ro

Re: [algogeeks] Adobe Interview Question

2012-12-11 Thread manish untwal
i answered with the...system call too..but he said...do it in C programming language only don't use...system call here!! On Tue, Dec 11, 2012 at 10:32 PM, saurabh singh wrote: > stdin is a file pointer. > freopen returns a file pointer.. > I suggest using read system call. > > For the second que

Re: [algogeeks] Adobe Interview Question

2012-12-11 Thread manish untwal
i think, i replied with the same answer and he was not convinced On Tue, Dec 11, 2012 at 11:02 AM, amrit harry wrote: > 1st: > > freopen("filename","r",stdin); > > while(scanf("%s",str)!=-1) > { > printf("%s\n",str); > } > > > On Sun, Dec 9, 2012 at 3:22 PM, manish untwal wrote: > >> I gave this

Re: [algogeeks] Adobe Interview Question

2012-12-11 Thread saurabh singh
stdin is a file pointer. freopen returns a file pointer.. I suggest using read system call. For the second question it would be simply (len)!/((frequency_0)!*(frequency_1)!*(frequency_2)!...) However this will also contains permutations which begin with 0. So subtract the number of permutatio

Re: [algogeeks] Array Problem

2012-12-11 Thread manish untwal
@wladimir yes the problem seems to be that!! On Tue, Dec 11, 2012 at 10:13 AM, Wladimir Tavares wrote: > subset sum? > Wladimir Araujo Tavares > *Federal University of CearĂ¡ > Homepage | > Maratona

Re: [algogeeks] Adobe Interview Question

2012-12-11 Thread amrit harry
1st: freopen("filename","r",stdin); while(scanf("%s",str)!=-1) { printf("%s\n",str); } On Sun, Dec 9, 2012 at 3:22 PM, manish untwal wrote: > I gave this interview in August this year, two of the question i was not > able to answer properly > 1) how to print the content of file in C without us