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 7796

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 4373

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

1 4985

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

1 7316

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

1 11179

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

1 7599

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

CSC,

3 10719

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

1 13178

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

1 7860

Printf can be implemented by using __________ list.

3 10416

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

1 6971

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 8979

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

Wipro,

3 9720

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

2055

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

HCL, Wipro,

14 100396


Un-Answered Questions { Code Snippets }

write a program that can LOCATE and INSERT elements in array using c++ programming languages.

3419


exception org.apache.jasper.JasperException: java.lang.NullPointerException org.apache.jasper.servlet.JspServletWrapper.handleJs pException(JspServletWrapper.java:491) org.apache.jasper.servlet.JspServletWrapper.service( JspServletWrapper.java:419) org.apache.jasper.servlet.JspServlet.serviceJspFile( JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServ let.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.j ava:717) root cause java.lang.NullPointerException org.apache.struts.taglib.TagUtils.retrieveMessageRes ources(TagUtils.java:1175) org.apache.struts.taglib.TagUtils.message(TagUtils.j ava:1038) org.apache.struts.taglib.bean.MessageTag.doStartTag( MessageTag.java:224) org.apache.jsp.register_jsp._jspx_meth_bean_005fmess age_005f0(register_jsp.java:138) org.apache.jsp.register_jsp._jspService(register_jsp .java:94) org.apache.jasper.runtime.HttpJspBase.service(HttpJs pBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.j ava:717) org.apache.jasper.servlet.JspServletWrapper.service( JspServletWrapper.java:377) org.apache.jasper.servlet.JspServlet.serviceJspFile( JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServ let.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.j ava:717)

3373


Write a function that takes as input a binary tree, and prints out each level of the tree on a newline. For example: a / b c / / d e f will output: a b c d e f

1319


In LSMW , what does the following error mean and how to rectify it : Incorrect interface data for set 78 in method C . This error is occuring in idoc processing step of LSMW.

2125


How can you relate the function with the structure? Explain with an appropriate example.

2909






how to manage mlng timer because they don't explain what's it's function?

2448


Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??

1766


Design a timer circuit using VHDL which has the following: input : start_timer(ST) output: long_time(LT) short_time(ST) when the timer is triggered by the ST(either 0 or 1) signal the timer should generate two timing signals accordingly.While the long time is going ON the other should be OFF and vice versa.

2094


How to find No of classes,Packages,No of Methods per Classes and Depth of Inheritance for selecting source code in windows form application using c# .net? (Source code is input Program. It may be Java or .net) Please help me..) Thanks..)

2217


What are nested elements in XML?

345


Write a simple encryption program using string function which apply the substitution method.

5527


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

1968


write a function that reverse the elements of an array in place.The function must accept only one pointer value and return void.

3942


Reading which Non-Character Key was pressed

1681


What is XML Element?

393