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 8287

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 4785

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

1 5365

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

1 7683

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

1 11879

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

1 8031

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

CSC,

3 11497

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

1 13791

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

1 8332

Printf can be implemented by using __________ list.

3 11015

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

1 7370

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 9614

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

Wipro,

3 10380

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; }

2299

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

HCL, Wipro,

14 102667


Un-Answered Questions { Code Snippets }

3) Int Matrix of certain size was given, We had few valu= es in it like this. =97=97=97=97=97=97=97=97=97=97=97 1 = | 4 | | 5 | &= nbsp; | 45 =97=97=97=97=97=97=97=97=97=97=97 &n= bsp; | 3 | 3 | 5 | = | 4 =97=97=97=97=97=97=97=97=97=97=97 34 |&nbs= p; 3 | 3 | | 12 | &= nbsp; =97=97=97=97=97=97=97=97=97=97=97 3 | &nbs= p; | 3 | 4 | = | 3 =97=97=97=97=97=97=97=97=97=97=97 3 | = ; | | | = ; 3 | =97=97=97=97=97=97=97=97=97=97=97 &= nbsp; | | 4 | = ; | 4 | 3 We w= ere supposed to move back all the spaces in it at the end. Note: = If implemented this prog using recursion, would get higher preference.

3528


Question 1: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date. *This Should Be Done IN C++

871


I am configuring my anaconda file in linux, i want to use as kickstart file, in post installation how can i edit file or change the content of file and save it.

2069


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

1163


Code for Using Keyboard Events?

2317


What is the functionality of FindWindow?

568


Can someone please explain more about how the XML Gateway works and what its purpose is?

2103


what is the structure of xml document ?

457


what full form name of B.K.U.

2871


Create a program to read two random data set in two files named data1.txt and data2.txt manifold contains integer numbers, whereas data2.txt file contains the float type numbers. Simpanlahmasing each into 2 pieces of data that is an array of type integer array and an array of type float, then calculate the average numbers in the second array.

2384


write a code to generate pseudorandom numbes

2026


create a stucture student containing field for roll no,class,year and marks.create 10 student annd store them in a file

2465


What are the features of XML?

457


What is the meaning of version in XML?

517


design a class car having variables model, yr_of_manufacture, owner,reg_no. Design methods for assigning the values, Printing the values( you decide gui,control, any other methods if require)

1969