tag:blogger.com,1999:blog-959939550345671470.post3525499434472684689..comments2024-03-24T12:51:18.535+05:30Comments on C programming Interview questions and answers: c interview questionsPriyanka kumarihttp://www.blogger.com/profile/08145649011863585828noreply@blogger.comBlogger25125tag:blogger.com,1999:blog-959939550345671470.post-16294021570122070782015-04-25T00:14:49.595+05:302015-04-25T00:14:49.595+05:30(!operand)=0 if operand is non zero.
(!operand)=1...(!operand)=0 if operand is non zero.<br />(!operand)=1 if operand is zero.<br />In Q.14 operand is non zero so <br />int x=sizeof(0) is 2 for 16 bit.sandeep kumarhttps://www.blogger.com/profile/09102504603078310420noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-44877492784348498732013-08-24T23:26:10.431+05:302013-08-24T23:26:10.431+05:30can any one pls explain the working of '!'...can any one pls explain the working of '!' operator in Q.14??<br />int x = sizeof(!5.856);<br /><br />and also Q 18....Subhajit Royhttps://www.blogger.com/profile/01067626099521220834noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-61968077760519491942011-11-19T18:11:47.704+05:302011-11-19T18:11:47.704+05:30#include
int main()
{
extern int i;
i=20;
printf(&...#include<br />int main()<br />{<br />extern int i;<br />i=20;<br />printf("%d/n",size of(i));<br />return 0;<br />}Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-64122634301578689182011-11-13T18:13:46.731+05:302011-11-13T18:13:46.731+05:30write the program for using for loop[perfect logic...write the program for using for loop[perfect logic]<br />Example:Enter the value:5<br />* * * * *<br />* *<br />* *<br />* *<br />* * * * *SBM.blogspot.comhttps://www.blogger.com/profile/04628314693769996152noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-29129681184476590622011-09-26T01:46:03.350+05:302011-09-26T01:46:03.350+05:30thankxxxxxxxxxxxxthankxxxxxxxxxxxxARVIND YADAVhttps://www.blogger.com/profile/07861155576915323372noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-60240503621543304462011-09-20T23:25:02.663+05:302011-09-20T23:25:02.663+05:30its usefullits usefullAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-79962804145001042772011-09-18T01:11:16.631+05:302011-09-18T01:11:16.631+05:30@kalai- dude..in your question ..u hv used charact...@kalai- dude..in your question ..u hv used character array ch..bt getchar can take 1 value at a time..so,jst make "ch" a character constant...i.e char ch;<br /><br />also operators lyk +,- or expressions lyk a+b or float values are not allowed as a value to switch..<br />whereas 3+4 as value is perfectly fine..Deepeshnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-83083879733522520802011-09-18T00:47:34.422+05:302011-09-18T00:47:34.422+05:30Ritesh kumar is right..ans is 6..n his explainatio...Ritesh kumar is right..ans is 6..n his explaination is also satisfactory..<br /> @kalai..who told u dt a loop which ends wid semocolon is infinite loop.??<br />such loop incr/decr until it satisfies the condition..<br />like i=5 in 10th question..<br />bt when it again incremented,i become equal to 6..and condition failed..bt the value i=6 resists..Deepeshnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-25435283409325570682011-09-01T00:15:12.720+05:302011-09-01T00:15:12.720+05:30can u explain me 18th question?can u explain me 18th question?sathyahttps://www.blogger.com/profile/11105900409941188204noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-12428496602134785642011-08-27T19:33:16.125+05:302011-08-27T19:33:16.125+05:30answer for 10th ques is "infinite loop"....answer for 10th ques is "infinite loop".becoz loop ends with semicolon..kalaihttps://www.blogger.com/profile/02279180002356525547noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-8684085609642478572011-08-27T19:30:29.071+05:302011-08-27T19:30:29.071+05:30main()
{
char ch[10];
int a=6,b;
printf(&qu...main()<br />{<br /> char ch[10];<br /> int a=6,b;<br /> printf("Enter value for b:");<br /> scanf("%d",&b);<br /> printf("\nEnter your choice:");<br /> ch=getchar();<br /> switch(ch)<br />{<br /> case '+':printf("a=%d",a);<br /> break;<br /> case '-':printf("b=%d",b);<br /> break;<br /> defaultkalaihttps://www.blogger.com/profile/02279180002356525547noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-60605044619552752722011-08-24T23:39:44.490+05:302011-08-24T23:39:44.490+05:30the answer for 10th will be 5
because of post incr...the answer for 10th will be 5<br />because of post increment...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-4284104193256464082011-08-23T18:32:00.561+05:302011-08-23T18:32:00.561+05:30In Question no. 10 when value of i =5 then loop c...In Question no. 10 when value of i =5 then loop condition is true so value of i will be incremented once again i.e. i=6. Now control will come out the for loop since loop condition is false.Priyanka kumarihttps://www.blogger.com/profile/08145649011863585828noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-8301143832881074412011-08-22T00:37:11.664+05:302011-08-22T00:37:11.664+05:30how the ans is 6not 5 in que. 10how the ans is 6not 5 in que. 10Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-64963920959485656692011-08-18T19:38:08.959+05:302011-08-18T19:38:08.959+05:30Excellent to learn.. Thanku.Excellent to learn.. Thanku.Nupurhttp://www.gooogle.comnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-70393296968802935742011-08-09T22:25:31.119+05:302011-08-09T22:25:31.119+05:30onnum parayanillaa...heavvyonnum parayanillaa...heavvyAKHIL VMhttps://www.blogger.com/profile/12550669027428076757noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-1704969325852492932011-08-04T22:49:54.571+05:302011-08-04T22:49:54.571+05:30Please add new questions with answer.Please add new questions with answer.Chhote Lalhttps://www.blogger.com/profile/15616617105191644317noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-67961029769603250002011-07-28T07:06:05.815+05:302011-07-28T07:06:05.815+05:30this is very gud......this is very gud......RAHULhttps://www.blogger.com/profile/12972250148574514840noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-41964878222812965332011-07-09T15:40:32.350+05:302011-07-09T15:40:32.350+05:30Hi Loga and Ravi,
Could you please tell me the c c...Hi Loga and Ravi,<br />Could you please tell me the c compiler where its not cahnging.Priyanka kumarihttps://www.blogger.com/profile/08145649011863585828noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-62017795913705516822011-07-09T14:58:01.727+05:302011-07-09T14:58:01.727+05:30yes loga is write,its not changing,i have also tri...yes loga is write,its not changing,i have also tried it,can u help as? plzRavi Gulatihttps://www.blogger.com/profile/07410028475853005710noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-82858730157944228312011-06-26T16:13:54.482+05:302011-06-26T16:13:54.482+05:30regarding the modification of a constant variable ...regarding the modification of a constant variable using pointer, i tried the same code.. but it is not being changed.. can u help me pls...logahttps://www.blogger.com/profile/07412589962514104885noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-54740670460739354482011-06-03T18:09:52.353+05:302011-06-03T18:09:52.353+05:30very
usefullvery <br />usefullAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-48915773046044080732010-04-27T21:56:30.297+05:302010-04-27T21:56:30.297+05:30lavanya dont u knoe anything.i thing u have two tu...lavanya dont u knoe anything.i thing u have two tunkAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-62093512828955814742010-04-13T15:47:26.762+05:302010-04-13T15:47:26.762+05:30its uselessits uselessUnknownhttps://www.blogger.com/profile/00475037542735704021noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-52017309031395443712010-04-13T15:46:06.488+05:302010-04-13T15:46:06.488+05:30usefullusefullUnknownhttps://www.blogger.com/profile/00475037542735704021noreply@blogger.com