Code Snippets Interview Questions
Questions Answers Views Company eMail

void main() { printf(“sizeof (void *) = %d \n“, sizeof( void *)); printf(“sizeof (int *) = %d \n”, sizeof(int *)); printf(“sizeof (double *) = %d \n”, sizeof(double *)); printf(“sizeof(struct unknown *) = %d \n”, sizeof(struct unknown *)); }

1 8321

char inputString[100] = {0}; To get string input from the keyboard which one of the following is better? 1) gets(inputString) 2) fgets(inputString, sizeof(inputString), fp)

1 4818

Which version do you prefer of the following two, 1) printf(“%s”,str); // or the more curt one 2) printf(str);

1 5392

void main() { int i=10, j=2; int *ip= &i, *jp = &j; int k = *ip/*jp; printf(“%d”,k); }

1 7701

void main() { char ch; for(ch=0;ch<=127;ch++) printf(“%c %d \n“, ch, ch); }

1 11913

Is this code legal? int *ptr; ptr = (int *) 0x400;

1 8049

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

CSC,

3 11532

main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }

1 13818

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

1 8355

Printf can be implemented by using __________ list.

3 11058

char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }

1 7393

char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }

2 9653

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

Wipro,

3 10410

what mean void creat_object?in public class in this code class A{ public: int x; A(){ cout << endl<< "Constructor A";} ~A(){ cout << endl<< "Destructor A, x is\t"<< x;} }; void create_object(); void main() { A a; a.x=10; { A c; c.x=20; } create_object(); } void create_object() { A b; b.x=30; }

2333

How we print the table of 2 using for loop in c programing?

HCL, Wipro,

14 102817


Un-Answered Questions { Code Snippets }

What is the code of Password Recovery or Forget your password? Plz tell in c # language.

3768


Write a Program to find the sum of digits of a given number until the sum becomes a single digit.

681


Write a python program to swap the first and last value of a list?

709


code to images to rollover

2067


What is the output, suppose list1 is [1, 3, 2], what is list1 * 2 ?

1175


How to create Date method to set the date in Ms Access

2080


what mean void creat_object?in public class in this code class A{ public: int x; A(){ cout << endl<< "Constructor A";} ~A(){ cout << endl<< "Destructor A, x is\t"<< x;} }; void create_object(); void main() { A a; a.x=10; { A c; c.x=20; } create_object(); } void create_object() { A b; b.x=30; }

2333


How to access oralce10g data from server to client in LAN?

1374


How to print sum of the numbers starting from 1 to 100?

611


i have some csv files in a directory which have sub-directories also. now how can i merge all .csv files in to one with a single header. for example: have some 4 files. 1.csv--------name,age,sal abc,25,4000 2.csv--------name,age,sal vgd,32,3500 3.csv--------name,age,sal hfg,20,5000 4.csv--------name,age,sal asd,15,2000 now my output file should be like 5.csv----------name,age,sal abc,25,4000 vgd,32,3500 hfg,20,5000 asd,15,2000 and please explain the code for me. as i am new to scripting. thank you in advance

1588


code to detect versions of different browsers like internet explorer, netscape, mozilla, opera etc

1940


why nlogn is the lower limit of any sort algorithm?

2575


What is 301 redirects in php? When are we used 301 redirects in our projects?

2164


What output does this program generate as shown? Why? class A { A() { cout << "A::A()" << endl; } ~A() { cout << "A::~A()" << endl; throw "A::exception"; } }; class B { B() { cout << "B::B()" << endl; throw "B::exception"; } ~B() { cout << "B::~B()"; } }; int main(int, char**) { try { cout << "Entering try...catch block" << endl; A objectA; B objectB; cout << "Exiting try...catch block" << endl; } catch (char* ex) { cout << ex << endl; } return 0; }

811


Given a circular list of integers (when you reach the end of the list you come back to the beginning), what is the most efficient algorithm to find the smallest integer in the list? For example: circular_list = [22, 52, 66, 82, 5, 8, 12, 19].

1562