# Programming Interview Questions

Sub Category
Questions
Answers
Last Updated
60
267
Nov 27th, 2018
23
37
Jul 14th, 2017
26
41
Apr 5th, 2018
27
29
Jul 25th, 2017
66
248
May 21st, 2018
101
523
Mar 25th, 2018
25
86
Sep 11th, 2018
63
78
Nov 21st, 2017
21
27
Apr 27th, 2017
46
125
Feb 3rd, 2016

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

#### 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

#### Teja

• Oct 8th, 2017

int arr[] = {4,2,6,1,7,12,10,11}; int min= arr; int max= arr; int total = 0; int avg; for(int i=0; i arr[i]) { min = arr[i]; } else if(max < arr[i]) { max = arr[i];...

#### Shubhangi

• Oct 5th, 2017

I inserted a code but how to get exact decimal point answer for avg,I didnt get .

```Code#include<stdio.h>
main()
{
int arr;
int i,size;
size=sizeof(arr)/sizeof(arr);
printf("enter the array elemrnt......
");

for(i=0;i<size;i++)
//scanf("%d",&arr[i]);
arr[i]=rand()%100;

for(i=0;i<size;i++)
printf("%d      ",arr[i]);
printf("
");

//lowest number....
int temp=arr;
for(i=1;i<size;i++)
{
if(temp>arr[i])
temp=arr[i];
else
continue;
}
printf("lowest element=%d
",temp);
//highewst numer
temp=arr;
for(i=1;i<size;i++)
{
if(temp<arr[i])
temp=arr[i];
else
continue;
}
printf("highest element=%d
",temp);

//toatal of numbers
int sum =0;
for(i=0;i<size;i++)
{
sum=sum+arr[i];
}
printf("total of an array:%d
",sum);
//average
int avg;
avg=sum/size;
printf("average=%d
",avg);

}
```

•

#### 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.

#### sravani reddy

• Sep 21st, 2017

```Code#include<stdio.h>
int main()
{
int rem,sum=0,n;
printf("enter the number:");
scanf("%d
",&n);
while(n!=0)
{
rem=n%10;
sum=sum+rem;
n=n/10;
}
printf("the sum of digits of a number is %d",sum);
return 0;
}```

#### Shasan

• Mar 29th, 2016

"c# public static int Sum() { int n = 1235678; int n1 = 0; int f = 0; while (n!= 0) { ...

•

#### 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.

#### gyanendra verma

• Aug 20th, 2017

"c #include void main() { int n1,n2,i,temp,b,j,c,check,count=0,a; clrscr(); printf("enter starting number: "); scanf("%d",&n1); //n1=32 printf("enter ending number: "); ...

#### anonymous

• Apr 5th, 2017

Basically the same, but in node :)

```Codevar desired = [];
for(var i = 32; i <= 99; i++) {

var value = i * i;
var split1 = parseInt(value / 100);
var split0 = value % 100;
if(split1 + split0 == i) {
desired.push(i);
}
}

console.log("Desired values: " + desired);```

•

#### Secure Language

Which Language is more secure - Java or C?

#### Stefan Alenius

• Jun 7th, 2017

The language does not matter as much as the developers involved. Yes, there is a difference between the languages, just as it is a difference between a monkey wrench and a screwdriver, but both are ju...

#### turnball

• Apr 28th, 2016

Bad question really since you can write horribly insecure software under each but if all things are considered equal then Id say C is more inherently "secure." Still a bad question since you can write some spotty product in either language.

•

#### 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...

#### Lohitha

• Jul 30th, 2016

```Code#include<stdio.h>
int main()
{
int a,i,min,max,count=0;
printf("enter elements into array:");
for(i=0;i<20;i++)
scanf("%d",&a[i]);
min=a;
for(i=0;i<20;i++)
{
if(a[i]<min)
min=a[i];
}
max=a;
for(i=0;i<20;i++)
{
if(a[i]>max)
max=a[i];
count++;
}
printf("minimum value is:%d
",min);
printf("maximum value is:%d
",max);
printf("Number of elements in an aray:%d
",count);
return 0;

}```

•

#### 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...

#### Sunil shenoy

• May 16th, 2016

```Code#include<iostream>
using namespace std;
float ft_to_inch(float ft)
{
return ft*12;
}
main()
{
float f,i;
cout<<"Enter a Feet value:"<<endl;
cin>>f;
i=ft_to_inch(f);
cout<<"result in Inches: "<<i<<endl;
}```

#### 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) ...

•

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

TASK 1: 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...

#### prasobh

• Jan 20th, 2016

#Python solution # E R T Y U 1 # D F G H J 2 # C V B N M 4 #NJUE2C1M keys=[E,R,T,Y,U,1,D,F,G,H,J,2,C,V,B,N,M,4] key_board_width = 6 str...

#### S VISHNUVARDHAN

• Aug 14th, 2015

"cpp #include using namespace std; #include #include char answer; char a = {"ERTYU1","DFGHJ2","CVBNM4 ; class trace { //protected: char input; pu...

•

#### 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();
}```

•

#### 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 high = numlist low = numlist current = numlist 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.

•

#### 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 Profile Answers by krish3636 Questions by 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

•

#### Web table is not being recognized..!!

What if there are two web tables in a web page and if add those web tables into OR it is not being added, what will be the solution if we have to work on those web tables then?

•

#### Timer Sharing and Batch Processing

What are the advantages and dis-advantages of real time, timer sharing and batch processing?

•

#### suji Profile Answers by suji Questions by suji

• Mar 2nd, 2012

There are following shell operators

Arithmetic Operators.

Relational Operators.

Boolean Operators.

String Operators.

File Test Operators.

Showing Questions 1 - 20 of 42 Questions
First | Prev | Next | Last Page
Sort by:
|
Jump to Page:  