tag:blogger.com,1999:blog-959939550345671470.post1220719888087667500..comments2024-03-24T12:51:18.535+05:30Comments on C programming Interview questions and answers: Tricky c questions and answersPriyanka kumarihttp://www.blogger.com/profile/08145649011863585828noreply@blogger.comBlogger61125tag:blogger.com,1999:blog-959939550345671470.post-33999374232614552212017-12-03T19:50:45.439+05:302017-12-03T19:50:45.439+05:30Suggest me a book for these type of tricky problem...Suggest me a book for these type of tricky problems of c Surya Kalvashttps://www.blogger.com/profile/14356883201346369628noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-9958771737566456492016-07-27T20:23:52.210+05:302016-07-27T20:23:52.210+05:30very helpful site i love thisvery helpful site i love thisAnonymoushttps://www.blogger.com/profile/06522021001964688096noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-21999860406094089672016-01-08T00:03:50.796+05:302016-01-08T00:03:50.796+05:3050
The statement mixes decimal,octal(o)and hexadec...50<br />The statement mixes decimal,octal(o)and hexadecimal(ox).<br />Before addition,everything will be converted to binary format.Archanahttps://www.blogger.com/profile/04197456572132533885noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-74351884403866066892016-01-07T23:45:13.045+05:302016-01-07T23:45:13.045+05:30i = a, b, c;// stores a into i, discarding the unu...i = a, b, c;// stores a into i, discarding the unused b and c rvalues<br />i = (a, b, c);// stores c into i, discarding the unused a and b rvalues<br /><br />Comma works as an operator in first case. Precedence of comma operator is least in operator precedence table. So the assignment operator takes precedence over comma and the expression “i = a, b, c″ becomes equivalent to “(i = a), b, c″.<br /Archanahttps://www.blogger.com/profile/04197456572132533885noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-11405841209567883462016-01-07T23:08:55.370+05:302016-01-07T23:08:55.370+05:30i = a, b, c;// stores a into i, discarding the unu...i = a, b, c;// stores a into i, discarding the unused b and c rvalues<br />i = (a, b, c);// stores c into i, discarding the unused a and b rvalues<br /><br />Comma works as an operator in first case. Precedence of comma operator is least in operator precedence table. So the assignment operator takes precedence over comma and the expression “i = a, b, c″ becomes equivalent to “(i = a), b, c″. <br Archanahttps://www.blogger.com/profile/04197456572132533885noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-20545164247841265072015-10-31T12:53:17.932+05:302015-10-31T12:53:17.932+05:30binary form of int value 10 is 00000000 00001010 (...binary form of int value 10 is 00000000 00001010 (2Bytes)<br />binary form of -10 is its 2's compliment i.e., 11111111 11110110<br /><br />Now, size of char data type is 1 byte only,<br />so, *p will have value 11110110 only. (11111111 is excluded)<br />Negative form of 11110110 is its 2's compliment i,e. 00001010 whose decimal value is -10 which will be shown as the output.Rahul Barahpuriahttps://www.blogger.com/profile/07185821322739090096noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-6274953743822166712015-10-13T13:55:41.598+05:302015-10-13T13:55:41.598+05:30ITS GOOD FOR USITS GOOD FOR USAnonymoushttps://www.blogger.com/profile/09957546441987509363noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-86622603211300921412015-08-24T04:20:22.801+05:302015-08-24T04:20:22.801+05:30This site will gives more time pass for lovers of ...This site will gives more time pass for lovers of C, and can love C, in deep.thulasihttps://www.blogger.com/profile/17226919830392982588noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-31517479390415340572015-01-31T10:31:56.968+05:302015-01-31T10:31:56.968+05:30Hello!, could you plz explain me the precedence or...Hello!, could you plz explain me the precedence order in 16th question , especially II case i..e a=(1,2,3),<br />in a much more clear way.<br />Thank you shravan kashyaphttps://www.blogger.com/profile/10351457987296206390noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-70113035645966626242014-09-24T09:16:51.667+05:302014-09-24T09:16:51.667+05:30int main()
{
int a=15;
a=(++a)+015+0x15;
printf(&...int main()<br />{<br /> int a=15;<br />a=(++a)+015+0x15;<br />printf("%d",a);<br />return 1;<br />}<br /><br />i don't know how to work octal and hex hear so plz tell me what is o/p with explanation of that prog. Anonymoushttps://www.blogger.com/profile/08380957254513294870noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-25583147392762648122014-06-05T01:51:45.750+05:302014-06-05T01:51:45.750+05:30use fflush(); just before the 2nd scanf function.....use fflush(); just before the 2nd scanf function...<br />Himanshuhttps://www.blogger.com/profile/01149190789898186076noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-84982241305135813692014-04-06T18:13:39.891+05:302014-04-06T18:13:39.891+05:30kusuuuuuuuuuuuuuuuuuuuuuuukusuuuuuuuuuuuuuuuuuuuuuuuAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-49721727296189974802014-02-01T06:52:35.559+05:302014-02-01T06:52:35.559+05:30Really Helpful questions...good coverage of all to...Really Helpful questions...good coverage of all topics...Thanks a lot!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-32531016476317791632013-11-18T12:25:11.225+05:302013-11-18T12:25:11.225+05:30thanks for logical information
thanks for logical information<br />vijay kumarnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-51577156764918643542013-11-15T19:27:06.862+05:302013-11-15T19:27:06.862+05:30yeasuuuuuuu
yeasuuuuuuu<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-45566075531450688482013-10-09T14:04:57.993+05:302013-10-09T14:04:57.993+05:30Doubt in
void main(){
int i;
double a=5.2;
...Doubt in <br />void main(){<br /> int i;<br /> double a=5.2;<br /> char *ptr;<br /> ptr=(char *)&a;<br /> for(i=0;i<=7;i++)<br /> printf("%d ",*ptr++);<br />}<br />Anonymoushttps://www.blogger.com/profile/15944784041959237938noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-71892257901452094092013-09-11T17:52:22.641+05:302013-09-11T17:52:22.641+05:30explain the output of following question??
#includ...explain the output of following question??<br />#include<br />int main()<br />{<br /> int a=-10;<br /> char *p=(char *)&a;<br /> printf("%d",*p);<br /> return 0;<br />}Anonymoushttps://www.blogger.com/profile/04085097501084236328noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-60918702423078749052013-08-30T17:47:57.467+05:302013-08-30T17:47:57.467+05:30good workgood workAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-66478039725857421392013-08-29T20:06:22.172+05:302013-08-29T20:06:22.172+05:30sir plz.. add tutorials for file handling in c als...sir plz.. add tutorials for file handling in c also.<br />neerajkumarghildiyalhttps://www.blogger.com/profile/16623037751799025059noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-20969665170191086962013-08-28T14:10:23.654+05:302013-08-28T14:10:23.654+05:30int
rpow(int num, int power)
{
return power ==...int<br />rpow(int num, int power)<br />{<br /> return power == 0 ? 1 : num * rpow(num, power-1); <br />}<br /><br /><br /><br />main()<br />{<br /> int num, power;<br /> printf("Enter number : ");<br /> scanf("%d", &num);<br /> printf("to +ve power : ");<br /> scanf("%d", &power);<br /> if (power < 0) {<br /> printf(&Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-41733487820617647072013-08-12T20:03:03.220+05:302013-08-12T20:03:03.220+05:30Very good questions.........hope to see more in fu...Very good questions.........hope to see more in future!!!!Anonymoushttps://www.blogger.com/profile/17503659858388393897noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-30365671751118301172013-08-07T11:37:28.097+05:302013-08-07T11:37:28.097+05:30could i get answer for the following question.
Pr...could i get answer for the following question.<br /><br />Problem;<br />Given an English text print out the list of words and their anagrams in their order of occurrence. Word A is an anagram of word B if it can be derived from word B by merely shuffling the letters in word B.<br /><br />Important Points:<br /><br />Text can contain words in upper case as well as lower case and punctuation marks<ecehttps://www.blogger.com/profile/17082863808018618436noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-32214813407336792052013-08-06T15:19:50.944+05:302013-08-06T15:19:50.944+05:30What is the use of the following macro?
#define ...What is the use of the following macro?<br /> #define DPRINTF(x) printf("%s:%d\n",#x,x)Anonymoushttps://www.blogger.com/profile/08982269347179283087noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-19466412589615242102013-08-06T15:18:48.426+05:302013-08-06T15:18:48.426+05:30What is the differnce between the following functi...What is the differnce between the following function calls to<br />scanf?(Please notice the space carefully in the second call. Try<br />removing it and observe the behaviour of the program)<br /> #include <br /> int main()<br /> {<br /> char c;<br /> scanf("%c",&c);<br /> printf("%c\n",c);<br /><br /> scanf(" %c",&c);<br /> printfAnonymoushttps://www.blogger.com/profile/08982269347179283087noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-16561294734277148632013-08-06T15:16:22.319+05:302013-08-06T15:16:22.319+05:30The following C program segfaults of IA-64, but wo...The following C program segfaults of IA-64, but works fine on IA-32.<br /><br /> int main()<br /> {<br /> int* p;<br /> p = (int*)malloc(sizeof(int));<br /> *p = 10;<br /> return 0;<br /> }<br /><br />Why does it happen so?Anonymoushttps://www.blogger.com/profile/08982269347179283087noreply@blogger.com