Top Programming Code Interview Questions :: ALLInterview.com http://www.allinterview.com Top Programming Code 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 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< 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 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." 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]; 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) { 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 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. Link list in reverse order. http://www.allinterview.com/showanswers/28339.html recursive reverse(ptr) if(ptr->next==NULL) return ptr; temp=reverse(ptr->next); ptr=ptr->next; return ptr; end How do I write a program to print proper subset of given string . Eg http://www.allinterview.com/showanswers/36629.html aa Finding a number multiplication of 8 with out using arithmetic opera http://www.allinterview.com/showanswers/28342.html i << 3 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 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 Write out a function that prints out all the permutations of a string http://www.allinterview.com/showanswers/17149.html /*guys..I have implemented Jhonson trotter algorithm..u can print permutations of 123..n. implement the same for strings!*/ #include<iostream.h> #include<conio.h> int min(int a[10],int n) { int i,m=1; for(i=2;i<=n;i