# Programming Interview Questions

Sub Category
Questions
Last Updated
57
247
Jun 27th, 2015
22
37
Nov 25th, 2014
26
39
Feb 20th, 2015
27
28
Feb 27th, 2015
66
234
Jul 24th, 2015
100
490
Jul 19th, 2015
25
54
Jul 24th, 2015
63
76
Jul 24th, 2014
21
26
Oct 3rd, 2012
46
124
Jun 1st, 2015

Showing Questions 1 - 20 of 38 Questions
First | Prev | Next | Last Page
Sort by:
|
•

#### Generate no.between 32 to 99

Consider the following number
45*45=2025 and
20+25=45.
Write a program to generate no.between 32 to 99 that satisfy the above problem.

#### Sambuddha Chaudhuri

• Jul 16th, 2015

```Codepublic class sumbtw32and45{
public static void main(String args[]){
//Scanner sc = new Scanner(System.in);
//System.out.println("Enter the number between 32 and 99");
//int i = sc.nextInt();
//if(i >=32 && i <= 99)
int count = 0;
for(int i =32;i<=99;)
{
int j =i * i;
int temp = j %100;
int n = j /100;
int l = temp + n;
if(i == l){
System.out.println(i);
count = count +i;
i++;
}
else
i++;
}
System.out.println("the Sum of these Type of numbers is"+count);
}
}```

• Apr 17th, 2012

```Code#include<stdio.h>
#include<conio.h>
main()
{
int i,a,r,s,w;
");
for(i=32;i<=99;i++)
{
s=0;
w=i;
a=i*i;
while(a>0)
{
r=a%100;
s=s+r;
a=a/100;
}
if(w==s)
{
printf("                           %d
",w);
}
}
return 0;
} ```

•

#### Print Sum of Digits

Write a function to print sum of the digits in a given integer n without converting it to String. For example : if n = 1234 the function should return 1+2+3+4 = 10 if n = 15 the function should return 1+5 =6 if n = 5 the function should return 5.

#### Sambuddha Chaudhuri

• Jul 16th, 2015

"java import java.util.Scanner; public class fourdigit{ public static void main(String args[]){ int k = 0,j = 1,l = 1; Scanner sc = new Sc...

#### jenisha

• Jul 1st, 2012

"c #include main() { int n, sum = 0, remainder; printf("Enter an integer "); scanf("%d",&n); while(n != 0) { remainder = n % 10; sum = sum + remai...

•

#### Solve this Programming Task in language of preference

Imagine a customized computer keyboard with following layout :
ERTYU1
DFGHJ2
CVBNM4

The keyboard only has above set of keys in the panel , For a given set on input word you need to output the path taken to press them , for example :
Consider the input word is : RFGM
the output...

#### vinod378

• May 31st, 2015

```Code#include<stdio.h>
main()
{
char disc[3][6]={"ERTYU1","DFGHJ2","CVBNM4"};
char input[10];
scanf("%s",input);
int i,j,k,l,pos[4],p;
printf("PRESS %c
",input[0]);
for(p=0;input[p]!=;p++);
for(i=0;i<(p-1);i++)
{
for (l=0;l<2;l++)
{
for(j=0;j<3;j++)
{
for(k=0;k<6;k++)
{
if(input[i+l]==disc[j][k])
{
if (l==0)
{
pos[l]=j;
pos[l+1]=k;
}
else
{
pos[l+1]=j;
pos[l+2]=k;
}
break;
}
}
}
}
/*for (k=0;k<4;k++)
printf("%d ",pos[k]);
printf(" ");*/
if(pos[0]>pos[2])
{
for(j=0;j<(pos[0]-pos[2]);j++)
printf("GO UP
");
}
else if(pos[0]<pos[2])
{
for(j=0;j<(pos[2]-pos[0]);j++)
printf("GO DOWN
");
}
if(pos[1]>pos[3])
{
for(j=0;j<(pos[1]-pos[3]);j++)
printf("GO LEFT
");
}
if(pos[1]<pos[3])
{
for(j=0;j<(pos[3]-pos[1]);j++)
printf("GO RIGHT
");
}
printf("PRESS %c
",input[i+1]);

}

}
```

•

#### gaurav kumar jaiswal

• Aug 31st, 2014

Write a c++ program to the sum and product of digits of an integers

#### karuna gaur

• Apr 15th, 2013

456 sum is 15

```Codeint sumDigits(int n) {
int sum = 0;

while( n > 0 ) {
sum += (n % 10); // add last digit of n to sum
n /= 10; // divide n by 10 to "chop off" the last digit
}

return sum;

getch();
}```

•

#### Functions

1.One foot equals 12 inches. Design a function named
feetTolnches that accepts a number of feet as an argument, and returns the number of inches in that many feet. Use the function in a program that prompts the user to enter a number of feet and then displays the number of inches in that many feet.

2.Rainfall Statistics
Design a program that lets the user enter the total rainfall...

#### George

• Jul 29th, 2014

In Haskell (please excuse syntax highlighting; they dont have it for this language):"css -- feetToInches.hs module Main where feetToInches :: Num a => a -> a feetToInches = (*12) ...

•

#### Logic and Design

Number Analysis Program

Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and then display the following data:

â€¢ The lowest number in the array
â€¢ The highest number in the array
â€¢ The total of the numbers in the array
â€¢ The average of the numbers in the array

#### tnguyen25

• Jun 2nd, 2014

Thank you for your question. "c# private static int lowestNumberInArray(int[] numbers) { if (numbers.Length < 0) throw new ArgumentExce...

•

#### Analysis Number Design Flow chart

Number analysis program design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and then display the following data: the lowest number in the array,the highest number in the array and the total of the numbers in the array...

#### Michael Brown

• Apr 1st, 2014

"c numlist = [-7,1,2,45289, 7,5,9,7,4,-10,34,234345678,32,12,1566,0,8,5,4,2] sum = 0 current = numlist[0] high = numlist[0] low = numlist[0] current = numlist[0] for i in rang...

•

#### Arrays

Design a flow chart for program that displays the number of days in each month. the program should have two parllel arrays 12 element string array that is initialized with the names of the month, and 12 element integer array that is initialized the number of days in each month.

#### Cassandra Blackburn

• Sep 9th, 2013

Jan Month have 31 Days Feb Month have 28 days March Month have 31 Days April Month have 30 Days
May Month have 31 days June Month have 30 Days July Month have 31 days Aug Month have 31 Days
Sept Month have 30 Days Oct Month have 31 Days Nov Month have 30 days Dec Month have 31 Days

#### Ponni Vaithiyanathan

• Aug 20th, 2013

Jan Month have 31 Days feb Month have 28 Days March Month have 31 Days April Month have 30 Days May Month have 31 Days June Month have 30 Days july Month have 31 Days Aug Month have 30 Days sep Month ...

•

#### Career guidance

I m doing mca n m in 2nd semester. I want to have an experience abt my job. There are no software companies here, how can I experience abt the jobs related to my field...any kind of internship which I can do while staying here..pls guide me mam.

•

#### Flow

Number analysis program design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and then display the following data: the lowest number in the arraythe highest number in the array the total of the numbers in the arraythe...

•

#### Efficient algorithm to print count and possible string outcomes of a given input string

Write an Efficient algorithm to print count and possible string outcomes of a given input string by retaining order and considering all characters during this process

Problem: given a input string as "0000" and following input scheme for the zeroes, print the possible outcomes by retaining order of the characters. input scheme: a "0" b "00" c "000" d "0000" example: "aaaa" is one string...

#### cfphpflex@gmail.com

• Mar 21st, 2013

1. get string length 2. print length 3. for string 0000, its easy: 4. look at 0000 and quickly understand that each 0 in the string can only have 3 other possible 0 s to compare against and get a diff...

•

#### Reverse a sting using loop in php

Hi , when I reverse a string using loop in php like

php\$str="navin";
\$rstr="";
\$len=strlen(\$str);
for(\$i=\$len-1;\$i>=0;\$i--)
{
\$rstr.=\$str[\$i];
}
echo \$rstr;

It work but I want to know why we use .dot(.) \$rstr.=\$str[\$i]; over here thanks in advance

#### Emiliano Gaytan

• Mar 21st, 2013

to concat, . operator concats left & right values; Google it for more info "php \$myVar = 2; // declare variable in php print_r(\$myVar . ""); //print on screen your variable w htm...

•

#### If else in c++

Hi guys ,

in c++ programming (if) when we use "=" isntead of "==" compiler behave the same ... Do u know why compiler Behave like this ??

Tnx

#### vinodh

• Dec 11th, 2012

In the first if condition want to place double equal.then it will treat as condition.otherwise it will treat as declaration

#### krish3636

• Oct 26th, 2012

C++ compiler treat Zero(0) as false and all nonzero value as true.
Consider the case 1:
if(val=20) //implicitly it becomes if(20)
{
cout

•

#### Samba Attributes

What are the attributes of Samba?

#### suji

• Mar 2nd, 2012

Here are the samba attributes sambaLMPassword sambaNTPassword sambaPwdLastSet sambaAcctFlags sambaLogonTime sambaLogoffTime sambaKickoffTime sambaPwdCanChange sambaPwdMustChange sambaHomeDrive samb...

•

#### Cass to Track Number of Instances

Design a class that will keep track of number of instances that have been instantiated. Make this class thread safe.

#### Dearsi

• Feb 1st, 2012

Here

```Code1       public class Utility
2       {
3           public Utility()
4           {
5               InstanceCount++;
6           }
7
8           public static int InstanceCount;
9       }```

•

#### ashoknaina

• Dec 20th, 2011

```Code#include<stdio.h>
main()
{
int a[20][20],i,j,n,m,p,q,k=0;
printf("
Enter Order Of matrix");
scanf("%d%d",&m,&n);
for(i=1;i<=m;i++)
for(j=1;j<=n;j++)
scanf("%d",&a[i][j]);

p=m;
q=n;
i=j=1;

while(k<p*q)
{
for(;j<=n&&k<p*q;j++)
{
printf("%d ",a[i][j]);
k++;
}
j--;
i++;
for(;i<=m && k<p*q;i++)
{
printf("%d ",a[i][j]);
k++;
}
i--;
j--;
for(;j>=i-m+1 && k<p*q;j--)
{
printf("%d ",a[i][j]);
k++;
}
j++;
i--;
for(;i>1 && k<p*q;i--)
{
printf("%d ",a[i][j]);
k++;
}
if(k<p*q)
{
j++;
i++;
n--;
m--;
}
}
}```

#### Abhijit Singh

• Apr 27th, 2007

/*~~~~~~~~~ Creates square and  rectangular matrices ~~~~~~~~*//* Input required is dim of the spiral matrix. Just feed in two factors of the size of array. i.e If Items are 35 then m = 5 n ...

•

#### Case sensitive

Why the programing language are case sensitive as is not for user friendly.

#### ashoknaina

• Dec 19th, 2011

Yes th programming language is case sensitive because of its sensitivity that means the language itself having some built in keywords that are used to define variables and data types also vary accordi...

#### lavanyats

• Jul 27th, 2008

When a PL is case sensitive, the number of possible keywords/ variable names permissible is increased. Also - more important reason - program readability is improved - we use caps for macros, have different naming conventions based on case sensitivity and so on.

Showing Questions 1 - 20 of 38 Questions
First | Prev | Next | Last Page
Sort by:
|

#### Have Interview Question?

Please select the most appropriate category and mention a brief question title along with clear question details.

Name:
Email:
Category :
Sub Category :
Question Title:
Question in Detail :
Job Role (Optional) :
Company (Optional) :