Programming Code Interview Questions
Questions Answers Views Company eMail

#include main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }

1 4886

main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }

IBM,

2 11409

#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }

3 18376

main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }

Zoho,

1 20256

#include main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }

CNSI,

2 11189

#include main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); }

TCS,

1 8010

#include main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

2 10729

main() { extern int i; i=20; printf("%d",sizeof(i)); }

2 21390

main() { printf("%d", out); } int out=100;

3 11388

main() { extern out; printf("%d", out); } int out=100;

1 8978

main() { show(); } void show() { printf("I'm the greatest"); }

2 12358

main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(“%u %u %u %d \n”,a,*a,**a,***a); printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1); }

2 22532

main( ) { int a[ ] = {10,20,30,40,50},j,*p; for(j=0; j<5; j++) { printf(“%d” ,*a); a++; } p = a; for(j=0; j<5; j++) { printf(“%d ” ,*p); p++; } }

1 14361

main( ) { static int a[ ] = {0,1,2,3,4}; int *p[ ] = {a,a+1,a+2,a+3,a+4}; int **ptr = p; ptr++; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); *ptr++; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); *++ptr; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); ++*ptr; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); }

Persistent,

2 26463

main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }

1 6396


Un-Answered Questions { Programming Code }

What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?

3717


What is the functionality of SetForegroundWindow?

568


I need your help, i need a Turbo C code for this problem.. hope u'll help me guys.? Your program will have a 3x3 array. The user will input the sum of each row and each column. Then the user will input 3 values and store them anywhere, or any location or index, temporarily in the array. Your program will supply the remaining six (6) values and determine the exact location of each value in the array. Example: Input: Sum of row 1: 6 Sum of row 2: 15 Sum of row 3: 24 Sum of column 1: 12 Sum of column 2: 15 Sum of column 3: 18 Value 1: 3 Value 2: 5 Value 3: 6 Output: Sum of Row 1 2 3 6 4 5 6 15 7 8 9 24 Sum of Column 12 15 18 Note: Your program will not necessary sort the walues in the array Thanks..

2811


Given a table of the form: Product Sold on A 1/1/1980 B 1/1/1980 C 1/1/1980 A 1/1/1980 B 1/1/1980 C 2/1/1980 A 2/1/1980 There are 30 products and 10,000 records of such type. Also the month period during which sales happened is given to u. Write the program to display the result as: Product Month No. of copies A January 12 A February 15 A March 27 B January 54 B February 15 B March 10 C January 37

2051


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

3440






Using C# Write a program that performs the following. The user inputs a number and then enters a series of numbers from 1 to that number. Your program should determine which number (or numbers) is missing or duplicated in the series, if any. For example, if the user entered 5 as the initial number and then entered the following sequences, the results should be as shown. Input Sequence Output ---------------------- --------------- 1 2 3 4 5 Nothing bad However, if 7 were the high number, the user would see the results on the right for the following number entries: Input Sequence Output ---------------------- --------------- 1 3 2 4 5 Missing 6 Missing 7 And if 10 were the high number and the user entered the numbers shown on the left, note the list of missing and duplicate numbers: Input Sequence Output ---------------------- --------------- 1 2 4 7 4 4 5 10 8 2 6 Duplicate 2 ( 2 times) Missing 3 Duplicate 4 ( 3 times ) Missing 9 The program should check the high number that the user inputs to ensure that it does not exceed the size of any array you might be using for storage.

3707


Write a (n) algorithm that sorts n distinct integers, ranging in size between 1 and kn inclusive, where k is a constant positive integer. (Hint: Use a kn-element array.)

4453


How to get Filename from Path?

529


1.Why does only one copy of a servlet object get created? What happens if you want to remove an old servlet object currently running but do not want to stop the entire servlet engine? 2.How does one servlet object deal with interactions from many browser? (e.g. if your servlet ran an email site, how can it keep track of hundreds of users logging in, reading their mail, etc.)

2382


Write a program to convert postfix expression to infix expression.

4114


what are the other loops except for for,while,do while and until?

2290


Beautiful is for 012345678 9 and a code for similar word containing the same alphabets

5336


how to track links visited in google using iframes

2287


write a program for area of circumference of shapes

2038


could you please send the program code for multiplying sparse matrix in c????

3078