main()
{
char a[4]="HELL";
printf("%s",a);
}

Answers were Sorted based on User's Feedback



main() { char a[4]="HELL"; printf("%s",a); }..

Answer / susie

Answer :
HELL%@!~@!@???@~~!

Explanation:
The character array has the memory just enough to hold the
string “HELL” and doesnt have enough space to store the
terminating null character. So it prints the HELL correctly
and continues to print garbage values till it accidentally
comes across a NULL character.

Is This Answer Correct ?    25 Yes 10 No

main() { char a[4]="HELL"; printf("%s",a); }..

Answer / harshawardhan

HELL

It will print "HELL" because Character array of size 0 to 4 mean it may hold 5 places. One for Null character and other four for HELL total 5.

Is This Answer Correct ?    3 Yes 0 No

main() { char a[4]="HELL"; printf("%s",a); }..

Answer / thiyagu

hell

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More C Code Interview Questions

int aaa() {printf(“Hi”);} int bbb(){printf(“hello”);} iny ccc(){printf(“bye”);} main() { int ( * ptr[3]) (); ptr[0] = aaa; ptr[1] = bbb; ptr[2] =ccc; ptr[2](); }

1 Answers  


main() { struct date; struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }

1 Answers  


main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }

2 Answers  


main() { printf("%x",-1<<4); }

3 Answers   HCL, Sokrati, Zoho,


Cluster head selection in Wireless Sensor Network using C programming language.

0 Answers  






plz send me all data structure related programs

2 Answers  


main() { clrscr(); } clrscr();

2 Answers  


write a program to Insert in a sorted list

4 Answers   Microsoft,


main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(“%u %u %u %d \n”,a,*a,**a,***a); printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1); }

2 Answers  


#include<stdio.h> void fun(int); int main() { int a; a=3; fun(a); printf("\n"); return 0; } void fun(int i) { if(n>0) { fun(--n); printf("%d",n); fun(--n); } } the answer is 0 1 2 0..someone explain how the code is executed..?

1 Answers   Wipro,


abcdedcba abc cba ab ba a a

2 Answers  


create a C-code that will display the total fare of a passenger of a taxi if the driver press enter,the timer will stop. Every 10 counts is 2 pesos. Initial value is 25.00

0 Answers   Microsoft,


Categories