Code Snippets Interview Questions
Questions Answers Views Company eMail

main(){ char a[100]; a[0]='a';a[1]]='b';a[2]='c';a[4]='d'; abc(a); } abc(char a[]){ a++; printf("%c",*a); a++; printf("%c",*a); }

2 6521

func(a,b) int a,b; { return( a= (a==b) ); } main() { int process(),func(); printf("The value of process is %d !\n ",process(func,3,6)); } process(pf,val1,val2) int (*pf) (); int val1,val2; { return((*pf) (val1,val2)); }

Satyam,

1 9397

void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }

1 5524

void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }

1 11114

void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }

3 20811

void main() { unsigned giveit=-1; int gotit; printf("%u ",++giveit); printf("%u \n",gotit=--giveit); }

1 8953

void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); }

Accenture,

3 15607

void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }

Honeywell,

1 7269

void main() { int i=i++,j=j++,k=k++; printf(ā€œ%d%d%dā€,i,j,k); }

1 7883

void main() { static int i=i++, j=j++, k=k++; printf(ā€œi = %d j = %d k = %dā€, i, j, k); }

3 14992

void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }

1 14251

main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }

HP,

2 17149

#include main() { int x,y=2,z,a; if(x=y%2) z=2; a=2; printf("%d %d ",z,x); }

1 4788

main() { int a[10]; printf("%d",*a+1-*a+3); }

1 4927

#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); }

1 15284


Un-Answered Questions { Code Snippets }

Write a python program to check if a number is a perfect number?

503


How can you apply a DTD to an XML document?

361


what is main difference between array_push and array_pop?

3691


Is it possible to write JAVA program without including any of the packages,such as "import java.io.*"; bcoz I instantly wrote a code without "import..." statement and runned the program on command Line & it worked. the code is: class Person { String name; int age; Person(String s,int a) { name = s; age = a; } accept() { System.out.println(name+"Hi!!!!!"); System.out.println(age); } } class Demo { public static void main(Strings args[])throws IOException { String name = args[0]; int age = Integer.parseInt(args[1]); Person p = new Person(name,age); p.accept(); } }

1770


output for printf("printf");

1979






Write a python program to find the second largest number in a list?

483


Write a function which accepts list of nouns as input parameter and return the same list in the plural form. Conditions: i) if last letter is r then append s ii) if word ends with y then replace it by ies iii) call this function in main() and produce the required output. for eg:- if chair is input it should give chairs as output.

3989


How can I include conditional statements in XML?

354


how to write a program that opens a file and display in reverse order?

2561


JasperETL how to install and create simple project explain me clearly fnds iam wtg for ur rply

3624


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.

1939


Hello I am hosting remoting within IIS. Everything works just fine as long as I allow anonymous access at the IIS level. When I allow only Windows Authenticated sessions, something very strange happens: If the client activates the remote object with IP address - works fine If the client activates it using a machine name - get http 401 exception is thrown. The exception is thrown when the client calls the remote method. I set the channel's useDefaultCredentials property to true. Any idea how to allow Windows Authentication? Here is the call stack: System.Net.WebException: The remote server returned an error: (401) Unauthorized .. ---> System.ComponentModel.Win32Exception: The target principal name is incorrect at System.Net.NTAuthentication.GetOutgoingBlob(Byte[] incomingBlob, Boolean handshakeComplete) at System.Net.NTAuthentication.GetOutgoingBlob(String incomingBlob, Boolean handshakeComplete) at System.Net.NegotiateClient.DoAuthenticate(String challenge, WebRequest webRequest, ICredentials credentials, Boolean preAuthenticate) at System.Net.NegotiateClient.DoAuthenticate(String challenge, WebRequest webRequest, ICredentials credentials, Boolean preAuthenticate) at System.Net.NegotiateClient.Authenticate(String challenge, WebRequest webRequest, ICredentials credentials) at System.Net.AuthenticationManager.Authenticate(String challenge, WebRequest request, ICredentials credentials) at System.Net.AuthenticationState.AttemptAuthenticate (HttpWebRequest httpWebRequest, ICredentials authInfo) --- End of inner exception stack trace ---

4237


plzzzzzzzzz xplain this code import java.awt.*; import java.awt.event.*; //import java.awt.MenuItem.*; public class MenuForm extends Frame implements ActionListener { MenuBar mb=new MenuBar(); Menu m1=new Menu("Master"); Menu m2 =new Menu("Transactions"); Menu m3=new Menu("Queries"); Menu m4=new Menu("Reports"); Menu m5=new Menu("Daily/Weekly"); Menu m6=new Menu("Housekeeping"); Menu m7=new Menu("About"); Menu m8=new Menu("Utilities/Tools"); Menu m9=new Menu("exit"); MenuItem m11=new MenuItem("consumer master"); MenuItem m12=new MenuItem(""); MenuItem m13=new MenuItem(""); MenuItem m21=new MenuItem("New Connection"); MenuItem m22=new MenuItem("Refill Booking"); MenuItem m23=new MenuItem("Shop Delivery"); MenuItem m51=new MenuItem("Mrk Dlry"); MenuItem m91=new MenuItem("Quit"); /*MenuItem m131=new MenuItem(" "); MenuItem m132=new MenuItem(" "); MenuItem m134=new MenuItem(" ");*/ Font f=new Font("TimesRoman",Font.BOLD,16); Frame f1; public static void main(String args[]) { new MenuForm().setVisible(true); } public MenuForm() { super("Gas Agency Main Menu"); setSize(1280,800); setBackground(Color.lightGray); setLayout(null); setMenuBar(mb); /*m1.setFont(new Font("TimesRoman", Font.BOLD,16)); m2.setFont(new Font("TimesRoman", Font.BOLD,16)); m3.setFont(new Font("TimesRoman", Font.BOLD,16));*/ mb.add(m1); mb.add(m2); mb.add(m3); mb.add(m4); mb.add(m5); mb.add(m6); mb.add(m7); mb.add(m8); mb.add(m9); m1.add(m11); m1.add(m12); m1.add(m13); m2.add(m21); m2.add(m22); m2.add(m23); m5.add(m51); m9.add(m91); //m3.add(m31); /*m13.setEnabled(false); m13.add(m131); m13.add(m132); m13.add(m133); m13.add(m134); m13.add(m135);*/ setVisible(true); /*m11.addActionListener(this); m12.addActionListener(this); m13.addActionListener(this); m2.addActionListener(this); m3.addActionListener(this);*/ m21.addActionListener(this); m22.addActionListener(this); m23.addActionListener(this); /*m31.addActionListener(this); m131.addActionListener(this); m132.addActionListener(this); m133.addActionListener(this); m134.addActionListener(this); m135.addActionListener(this);*/ m51.addActionListener(this); m91.addActionListener(this); } public void actionPerformed(ActionEvent e) { /*if(e.getSource()==m11) { } if(e.getSource()==m12) { } if( (e.getSource()==m131) || (e.getSource() ==m132) || (e.getSource()==m133) || (e.getSource()==m134) || (e.getSource()==m135) ) { }*/ if(e.getSource()==m21) { NewConnection nc=new NewConnection (); nc.setVisible(true); this.dispose(); } if(e.getSource()==m22) { RefillBooking rb=new RefillBooking (); rb.setVisible(true); this.dispose(); } if(e.getSource()==m23) { ShopDelivery sd=new ShopDelivery(); sd.setVisible(true); this.dispose(); } if(e.getSource()==m51) { MarkDelivery mrk=new MarkDelivery(); mrk.setVisible (true); this.dispose(); } if(e.getSource()==m91) { this.dispose(); System.exit(0); } } }

1669


snippet to prevent submission of form when certain/any validations got failed

1552


what does mbln in mblnrects mean? my boolean?

2438