Archive for the ‘Interview’ Category

Predict the output!   4 comments

Q. I have an error free C code, am writing for you. This code searches for the string “C+Trivia” in Google. Surprised, how it can be? #include “stdio.h” #include “stdlib.h” int main() { http://www.google.com; char* str; printf(“C + Trivia”,str); puts(str); return 0; } Read more about this program here.

Posted August 1, 2009 by neeraj in Fun, Interview, Programming

Child process termination   Leave a comment

I was roaming through the Interprocess communication in Unix when i found something which can be shared: i am just copying and pasting it here: Child Process Termination Once we have created a child process, there are two possibilities. Either the parent process exits before the child, or the child exits before the parent. Now, [...]

Posted July 31, 2009 by neeraj in Interview, operating system

Tagged with , , , ,

What is being returned?   Leave a comment

#include “stdio.h” int main() { int i=10,j=20,k; k=addsub(i,j); printf(“k=%d”,k); return 0; } addsub(int c, int d) { int x,y; x=c-d;y=c+d; return (x,y); } it’s the value of y which is returned here, because return statement never gives error if you write more than one arguments to it separated by a comma..it’s the last argument which [...]

Posted July 26, 2009 by neeraj in Interview, Programming

Tagged with , , ,

which is faster ? p++; or p=p+1;   Leave a comment

p++ is faster because on compilation it gets translated to three machine instructions where as p=p+1 needs four machine instructions. All machine instructions take the same time. For p++ the instructions are: mov ax inc ax mov ax For p p+ 1 the instructions would be mov ax mov bx 1 add bx mov ax [...]

Posted July 20, 2009 by neeraj in Interview, Programming, Uncategorized

Tagged with , ,

Difference: FAT n NTFS?   1 comment

NTFS 1)allows access local to w2k w2k3 XP win NT4 with SP4 & later may get access for somefile. 2)Maximum size of partition is 2 Terabytes & more. 3)Maximum File size is upto 16TB. 4)File & folder Encryption is possible only in NTFS. FAT 32 1)Fat 32 Allows access to win 95 98 win millenium [...]

Posted July 19, 2009 by neeraj in Interview

Tagged with , , ,

Follow

Get every new post delivered to your Inbox.