Top Code Snippets Interview Questions :: ALLInterview.com http://www.allinterview.com Top Code Snippets Interview Questions en-us How to swap two variables, without using third variable ? http://www.allinterview.com/showanswers/17145.html Hi this question was asked in my interview. Ans is : a=a+b; b=a-b; a=a-b; Any other solution? how can u draw a rectangle in C http://www.allinterview.com/showanswers/23031.html BY USING PRINTF AND SCANF Write a function to find the depth of a binary tree. http://www.allinterview.com/showanswers/17140.html int Depth(struct Node*node,int level) { if(Node!=NULL) { if(level<depth) depth=level; Depth(Node->leftchild,level+1); Depth(Node->rightchild,level+1); } return(depth); } How to reverse a String without using C functions ? http://www.allinterview.com/showanswers/58562.html my_strrev(char str[Max]){ int i; // pointing to base adress int l; //pointing to last address strlen(str) -1th position char temp; for(i=0,l=strlen(str)-1;i<=l; i++ ,j--) { temp=str[i]; str[i]=str[l]; Program to find the largest sum of contiguous integers in the array. http://www.allinterview.com/showanswers/17157.html #include <iostream.h> #include<conio.h> main() { int s=-1,m=1,n,max=0,e=-1,sum=0,i,a[20]; cout<<"enter n:"; cin>>n; cout<<"enter elements:"; for(i=0;i<n;i++) cin>>a[i]; for(i=0;i< How to return multiple values from a function? http://www.allinterview.com/showanswers/18241.html Make array of values and return the array address as long. Now using pointer traverse through the value. How to send e-mail from an ASP.NET application? http://www.allinterview.com/showanswers/23045.html MailMessage message = new MailMessage (); message.From = <email>; message.To = <email>; message.Subject = "Scheduled Power Outage"; message.Body = "Our servers will be down tonight." 1)how i get the current system time using php? http://www.allinterview.com/showanswers/61489.html U can done it by using current timestamp option. Give a oneline C expression to test whether a number is a power of 2 http://www.allinterview.com/showanswers/18240.html #include<stdio.h> void main() { int number; printf("|n enter a number"); scanf("%d",&number); int twopower(int); printf("\n the given number is "); } int twopower(int num) { program to Reverse a linked list http://www.allinterview.com/showanswers/17137.html node *reverse(node *first) { node *cur,*temp; cur=NULL; while(first!=NULL) {temp=first; first=first->link; temp->link=cur; cur=temp; } return cur; } To Write a C program to remove the repeated characters in the entere http://www.allinterview.com/showanswers/59171.html int remove_duplicates(char *str) { int char_check=0; int i,j; char ch; if(str == NULL) return 0; /* check from 1st character in the string */ while(str[char_check]) { ch = str[char_check]; How to create and run runnable jar file of a Java Project. http://www.allinterview.com/showanswers/65167.html Common Examples ---------------- Let's say I have a Java application consisting of three source files that I wish to distribute: One.javaTwo.javaThree.java I also want to call my JAR file example.jar. To make a JAR file with just One print a semicolon using Cprogram without using a semicolon any where http://www.allinterview.com/showanswers/18235.html void main() { if(printf("semicolon")){} if(printf(getch())){} } how to check whether a linked list is circular. http://www.allinterview.com/showanswers/17148.html Create two pointers, each set to the start of the list. Update each as follows: while (pointer1) { pointer1 = pointer1->next; pointer2 = pointer2->next; if (pointer2) pointer2=pointer2->next; if (pointer1 == pointer2) { print How to convert string containing decimal point into integer in java? http://www.allinterview.com/showanswers/68913.html /* How to convert string containing decimal point into integer in java? For example given a string like "3.14" as input how to get integer 3 as result. */ String myStr = "3.14"; Int myInt = Float.valueOf(myStr).intvalue();