Which one is taking more time and why ?
:/home/amaresh/Testing# cat time.c
//#include <stdio.h>
#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 ?
No Answer is Posted For this Question
Be the First to Post Answer
what is brs test reply me email me kashifabbas514@gmail.com
Program to find the largest sum of contiguous integers in the array. O(n)
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
main() { int i=10; i=!i>14; Printf ("i=%d",i); }
main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }
main() { char *p; printf("%d %d ",sizeof(*p),sizeof(p)); }
how to delete an element in an array
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }
void ( * abc( int, void ( *def) () ) ) ();
Predict the Output: int main() { int *p=(int *)2000; scanf("%d",2000); printf("%d",*p); return 0; } if input is 20 ,what will be print
main() { char *p; int *q; long *r; p=q=r=0; p++; q++; r++; printf("%p...%p...%p",p,q,r); }
#include<stdio.h> int main() { int a=3,post,pre; post= a++ * a++ * a++; a=3; pre= ++a * ++a * ++a; printf("post=%d pre=%d",post,pre); return 0; }