amit tyagi


{ City } chitorgarh
< Country > india
* Profession * softwere engineer
User No # 61576
Total Questions Posted # 0
Total Answers Posted # 3

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

Users Marked my Answers as Correct # 4
Users Marked my Answers as Wrong # 8
Questions / { amit tyagi }
Questions Answers Category Views Company eMail




Answers / { amit tyagi }

Question { Wipro, 33286 }

what is the function of .h in #include in c ?


Answer

.h extension shows the type of file is header file. In turbo
c there are two file that are use for predefine function.as
header file which contains definition and explanations of
all function and constants and the extension of these file
is ".h".where the functions are kept in the library file
which have extension ".LIB".example
stdio.h
or
stdio.LIB

Is This Answer Correct ?    1 Yes 0 No

Question { HCL, 13051 }

write a program in reverse the string without using
pointer,array,global variable declaration,lib fun only using
a function?


Answer

#include
#include
void main()
{
FILE *f;
char c;
clrscr();
f=fopen("string","w");
while((c=getchar())!=EOF)
{
putc(c,f);
}
fclose(f);
f=fopen("string","r");
fseek(f,-1L,2);
do
{
putchar(getc(f));
}
while(!fseek(f,-2L,1));
fclose(f);
getch();
}

Is This Answer Correct ?    0 Yes 7 No


Question { 8111 }

#include
int main()
{
char *str[]={"Frogs","Do","Not","Die","They","Croak!"};
printf("%d %d\n",sizeof(str),strlen(str));
...return 0;
}
what will the output of the above program?


Answer

hi dear my name is Amit.
firtly i want to ask that you have used std.h. header
file.can u tell me about this one becuouse i am using
stdio.h header file instead of it.it can make an error if
it is not header file.second thing is that you have used
function strln() which is the function of string.h. to use
this function we have to this header file.it will produced
error with out this header file.
#include
#include
#include
main()
{
char *str[]={"Frogs","Do","Not","Die","They","Croak!"};
printf("%d %d\n",sizeof(str),strlen(str));
getch();
}
the out put will be 12 and 1....

Is This Answer Correct ?    3 Yes 1 No