amaresh ch das


{ City } bangalore
< Country > india
* Profession * software developer
User No # 9144
Total Questions Posted # 1
Total Answers Posted # 8

Total Answers Posted for My Questions # 0
Total Views for My Questions # 2195

Users Marked my Answers as Correct # 213
Users Marked my Answers as Wrong # 173
Questions / { amaresh ch das }
Questions Answers Category Views Company eMail

Which one is taking more time and why ? :/home/amaresh/Testing# cat time.c //#include #define EOF -1 int main() { register int c; while ((c = getchar()) != EOF) { putchar(c); } return 0; } ------------------- WIth stdio.h:- :/home/amaresh/Testing# time ./time_header hi hi hru? hru? real 0 m4.202s user 0 m0.000s sys 0 m0.004s ------------------ Witout stdio.h and with #define EOF -1 =================== /home/amaresh/Testing# time ./time_EOF hi hi hru? hru? real 0 m4.805s user 0 m0.004s sys 0 m0.004s -- From above two case , why 2nd case is taking more time ?

C Code 2195




Answers / { amaresh ch das }

Question { HCL, 19769 }

AMMONG THE 4 STROAGE CLASSES IN C, WHICH ONE FASTEST?


Answer

Register.
Since the register variable is stored in CPU.

try once applying a programme:--

and check it it's execution time Using..

time ./a.out

Is This Answer Correct ?    5 Yes 0 No

Question { Verifone, 27840 }

int a=1,b=2,c=3;
printf("%d,%d",a,b,c);
What is the output?


Answer

Ans:1,2

because arguments of functions stored in stack in FIFO order

So Var a enters 1st so it will out (popped)1st too as it's
STACK's property.

Is This Answer Correct ?    10 Yes 7 No


Question { Sun Microsystems, 42595 }

What is the difference between a variable and value?


Answer

Variable itself a Variable and you Can assign anything with
variable.Some Value is Assigned to Variable.It's place in
memory is in Global.so you can change the assigned value to
the variable.

Value is a constant.It's palace is in Readonly memory mean
you can't change. as it's constant.

Is This Answer Correct ?    40 Yes 17 No

Question { IBM, 24316 }

what is difference between ++(*p) and (*p)++


Answer

++(*p)-> Here ,increments the address of p
(*p)++ -> Here , Increments the Value of p

Is This Answer Correct ?    5 Yes 9 No

Question { ITC Infotech, 10777 }

Why we are writting shell scripts?
Plz if possible explain it briefly.


Answer

1>Interactive mood:--
As Shell scripting is working like as interpreter (not
likely compiler) in a interactive mood.
2> Less time:--
it will take less time than C or C++ or other file to process.


Is This Answer Correct ?    5 Yes 0 No

Question { TCS, 101912 }

How to reverse a String without using C functions ?


Answer

my_strrev(char str[Max]){
int i; // pointing to base adress
int l; //pointing to last address strlen(str) -1th position
char temp;
for(i=0,l=strlen(str)-1;i<=l; i++ ,j--)
{
temp=str[i];
str[i]=str[l];
str[l]=temp;
}
return str;
}

Is This Answer Correct ?    142 Yes 136 No

Question { Tech Mahindra, 10042 }

What is network Entry procedure in WIMAX -TEch mahidra
question?


Answer

Go to the Section of Network entry and Initialization of
wimax std 802.16d (page 167, section , 6.3.9)

The phases are :-

1. It scans the download channel and established
synchronization with the BS (Base station)
2. Obtain the transmit parameter (from UCD message)
3. Perform ranging.
4. Negotiate basic capabilities.
5. Authorize SS and performs key exchange for privacy.
6. Perform registration.
7. Established IP connectivity.
8. Established TOD (time of Day)
9. Transfer operational parameters.
10. Setup connection .

Get many more related this..

http://ittipsandtrics.blogspot.com

Is This Answer Correct ?    4 Yes 0 No

Question { Satyam, 18930 }

HOW TO SWAP TWO NOS IN ONE STEP?


Answer

amaresh@Hare-Krishna:~$ cat swp.c
#include
int
main(){
int a=5,b=6; // Compile using gcc -Wall
#ifdef DEBUG // to avoid compiler warnings
a ^=b^=a^=b;
#endif
printf("value of a is %d and b is %d\n",a,b);
return 0;
}

Is This Answer Correct ?    2 Yes 4 No