#include<std.h>
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?

Answers were Sorted based on User's Feedback



#include<std.h> int main() { char *str[]={"Frogs","Do","Not",..

Answer / sr. amit tyagi

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<stdio.h>
#include<conio.h>
#include<string.h>
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

#include<std.h> int main() { char *str[]={"Frogs","Do","Not",..

Answer / janava

In this it generate an error because declaration the array
as char but read the variable as integer.

Is This Answer Correct ?    7 Yes 6 No

#include<std.h> int main() { char *str[]={"Frogs","Do","Not",..

Answer / s.ramakrishna

thw output becomes 6 6
why because the character pointer stores their values and
that will be printed

Is This Answer Correct ?    4 Yes 3 No

#include<std.h> int main() { char *str[]={"Frogs","Do","Not",..

Answer / naresh lingampally

will be a error since ..

syn: *x will be a pointer and it would always be a digit .
so no variable address can be a character ...

MAKES SENSE ?

Is This Answer Correct ?    0 Yes 1 No

#include<std.h> int main() { char *str[]={"Frogs","Do","Not",..

Answer / guest

6


Is This Answer Correct ?    0 Yes 2 No

#include<std.h> int main() { char *str[]={"Frogs","Do","Not",..

Answer / kelly baby

Hello dear new friend,
my name is Kelly i read your profile and i decided to
contact you hopping that you will accept me as your friend,
please if you accept my request reply my true my email
address (kellybaby004@yahoo.in) so that i will send you my
picture and tell you more about me, do not late far
decadence be a barrier let love cornet because love is
abridge cornet far decadence to be lose.
yours kelly

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More C Interview Questions

Define recursion in c.

0 Answers  


Explain what is a static function?

0 Answers  


write a program in c to find out the sum of digits of a number.but here is a condition that compiler sums the value from left to right....not right to left..

1 Answers  


Write a program to give following output..... ********* **** **** *** *** ** ** * * ** ** *** *** **** **** *********

4 Answers  


int a=0,b=2; if (a=0) b=0; else b=*10; What is the value of b ?

6 Answers   TCS,






Is fortran still used in 2018?

0 Answers  


write a program that will read the temperature in Celsius and convert that into Fahrenheit.

1 Answers  


What is operator precedence?

0 Answers  


What is the output for the following program #include<stdio.h> main() { char a[5][5],flag; a[0][0]='A'; flag=((a==*a)&&(*a==a[0])); printf("%d\n",flag); }

5 Answers   ADITI, Wipro,


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

0 Answers  


.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }

0 Answers   Wilco,


Whats wrong with the following function char *string() { char *text[20]; strcpy(text,"Hello world"); return text; }

3 Answers   Qualcomm,


Categories