Code Snippets Interview Questions
Questions Answers Views Company eMail

main() { char *str1="abcd"; char str2[]="abcd"; printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd")); }

1 11387

main() { char not; not=!2; printf("%d",not); }

1 13416

#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }

1 8882

main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }

1 15561

main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }

1 4839

#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }

1 10154

int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }

1 17584

main() { int *j; { int i=10; j=&i; } printf("%d",*j); }

HCL, Wipro,

9 18704

main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }

1 4461

#include main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }

1 7352

#include main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d..%d",*p,*q); }

1 12923

#include main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }

2 5182

main() { int i=5,j=6,z; printf("%d",i+++j); }

2 17880

struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main() { struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }

1 5195

struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); }

1 9207


Un-Answered Questions { Code Snippets }

Hi, I want the code to fetch multiple rows in REXX using RLX and CURSOR. Can anyone help me?

2037


Write a Program to find the number of words in a sentence.

519


How to find the list of users who have two codes su01 and pfcg? thank in advance all.

1691


ArrayList declaration in .net

2741


How to export 2 datatables of a single dataset to 2 different worksheets of a single MSExcel file ?

1937






Sir... please give some important coding questions asked by product companies..

1793


can everyone explain this code Private Sub DrawRect(rectSource As RECT, lngColour As Long) Line (rectSource.Left, rectSource.Top)-(rectSource.Left, rectSource.Bottom), lngColour Line (rectSource.Left, rectSource.Top)- (rectSource.Right, rectSource.Top), lngColour Line (rectSource.Right, rectSource.Bottom)- (rectSource.Right, rectSource.Top), lngColour Line (rectSource.Right, rectSource.Bottom)- (rectSource.Left, rectSource.Bottom), lngColour End Sub

2253


Write a code snippet to display an integer in a binary format?

488


How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?

2012


write a program that creates a sequenced array of numbers starting with 1 and alternately add 1 and then 2 to create the text number in the series , as shown below. 1,33,4,6,7,9,............147,148,150 Then , using a binary search , searches the array 100 times using randomly generated targets in the range of 1 to 150

3260


Common UI for Multiple web applications. Suppose there are 35 websites using same third party controls.These 3rd party controls are made together that all 35 websites can use these controls.If we put all 3rd party controls and use its dll in 35 websites,only class files will be accessable. But I want to use CSS,images also in all 35 websites. how I can design the N-tier solution for this project.

2246


how to create a Draggable element

1968


How to Check if Folder Exists?

554


can any body give me answer to this question please? please give me code in cl with the folling specifications. 1.Accept 2 parameters-date and date type 2.If date type is J then convert date to *MDY format 3.If date type is M convert date to *JUL format 4. Send a program message with the value of converted date? Please give me the answer.Because im practicing in my house.Im taking trining on AS/400.

1902


write a code to generate pseudorandom numbes

1780