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 ?
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
write a c program to Create a registration form application by taking the details like username, address, phone number, email along with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 5 users and display the details. In place of password display “****”. (Use Structures).
0 Answers CDAC, College School Exams Tests,
What is the main difference between STRUCTURE and UNION?
main() { char a[4]="HELL"; printf("%s",a); }
main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }
write a c program to Reverse a given string using string function and also without string function
Write a program to receive an integer and find its octal equivalent?
main() { int a=2,*f1,*f2; f1=f2=&a; *f2+=*f2+=a+=2.5; printf("\n%d %d %d",a,*f1,*f2); }
#include<stdio.h> main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }
How can i find first 5 natural Numbers without using any loop in c language????????
main() { extern int i; i=20; printf("%d",i); }
why is printf("%d %d %d",i++,--i,i--);