GeekInterview.com
Series: Subject: Topic:

Programming Interview Questions

 
Sub Categories (+ View)
Subject Name
Questions
Answers
Last updated
52
225
Dec
13th,
2013
65
218
Nov
20th,
2013
98
472
Feb
5th,
2014
24
41
Apr
29th,
2013
63
75
Jan
7th,
2014
46
123
Jul
31st,
2012
Showing Questions 1 - 20 of 21 Questions
First | Prev | | Next | Last Page
Sort by: 
 | 

Analysis number design flow chart

Asked By: pokhara | Asked On: Apr 17th, 2013

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

Answered by: Michael Brown on: 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

Asked By: pokhara | Asked On: Apr 17th, 2013

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.

Answered by: Cassandra Blackburn on: 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

Answered by: Ponni Vaithiyanathan on: 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 ...

Flow

Asked By: pokhara | Asked On: Apr 17th, 2013

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

Write a program to read a four digit integer and print the sum of its digits.Write a program that reads a floating point number and then displays the right-most digit of the integral part of the number.

Asked By: rishi | Asked On: Oct 21st, 2007

Answered by: karuna gaur on: Apr 15th, 2013

456 sum is 15

Code
  1. int sumDigits(int n) {
  2. int sum = 0;
  3.  
  4. while( n > 0 ) {
  5. sum += (n % 10); // add last digit of n to sum
  6. n /= 10; // divide n by 10 to "chop off" the last digit
  7. }
  8.  
  9. return sum;
  10.  
  11. getch();
  12. }

Answered by: mahamad on: Apr 17th, 2012

Code
  1. #include<stdio.h>
  2. #include<conio.h>
  3. main()
  4. {
  5.         float f;
  6.         int s,r,k=1;
  7.         printf("Enter the number:=>");
  8.         scanf("%f",&f);
  9.         s=f/1;
  10.         while(k==1)
  11.         {
  12.                 r=s%10;
  13.                 printf("%d
  14. ",r);
  15.                 k++;
  16.         }
  17.         return 0;
  18. }

Logic and design

Asked By: pokhara | Asked On: Apr 15th, 2013

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

Functions

Asked By: pokhara | Asked On: Apr 15th, 2013

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

If else in C++

Asked By: Seniorija | Asked On: Oct 22nd, 2012

Hi guys , in C++ programming (if) when we use "=" isntead of "==" compiler behave the same ... Do u know why compiler behave like this ?? tnx

Answered by: vinodh on: 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

Answered by: krish3636 on: 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<<"Control comes here.";
}
Case 2:
val=5;
if(val==5) //implicitly it becomes if(1) as condition is true
{
cout<<"here control comes.";
}

Print sum of digits

Asked By: ayongying | Asked On: May 28th, 2010

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.

Answered by: jenisha on: 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...

Answered by: brajeshupd on: Jun 13th, 2012

"c #include #define MIN_REMAINDER 0 /* For checking the number */ int findSum(int); /* recursive function to find the Sum */ main() { int num = 1,sum...

Timer sharing and batch processing

Asked By: witty genius | Asked On: Feb 9th, 2011

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

Tell about shell aritmetic operators and functions.

Asked By: santhoshkumar | Asked On: Oct 23rd, 2007

Answered by: suji on: Mar 2nd, 2012

There are following shell operators

Arithmetic Operators.

Relational Operators.

Boolean Operators.

String Operators.

File Test Operators.

Samba attributes

Asked By: abhidepali | Asked On: May 13th, 2009

What are the attributes of samba?

Answered by: suji on: 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

Asked By: ayongying | Asked On: May 28th, 2010

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

Answered by: Dearsi on: Feb 1st, 2012

here

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

How to write spiral matrix program?

Asked By: Swati | Asked On: Feb 6th, 2007

Answered by: ashoknaina on: Dec 20th, 2011

Code
  1. #include<stdio.h>
  2. main()
  3. {
  4. int a[20][20],i,j,n,m,p,q,k=0;
  5. Enter Order Of matrix");
  6. scanf("%d%d",&m,&n);
  7. for(i=1;i<=m;i++)
  8. for(j=1;j<=n;j++)
  9.     scanf("%d",&a[i][j]);
  10.  
  11. p=m;
  12. q=n;
  13. i=j=1;
  14.  
  15. while(k<p*q)
  16. {
  17.     for(;j<=n&&k<p*q;j++)
  18.     {
  19.         printf("%d ",a[i][j]);
  20.         k++;
  21.     }
  22.     j--;  
  23.     i++;
  24.     for(;i<=m && k<p*q;i++)
  25.     {
  26.         printf("%d ",a[i][j]);
  27.         k++;
  28.     }
  29.     i--;
  30.     j--;    
  31.     for(;j>=i-m+1 && k<p*q;j--)
  32.     {
  33.         printf("%d ",a[i][j]);
  34.         k++;
  35.     }    
  36.     j++;
  37.     i--;
  38.     for(;i>1 && k<p*q;i--)
  39.     {
  40.         printf("%d ",a[i][j]);
  41.         k++;
  42.     }
  43.     if(k<p*q)
  44.     {
  45.         j++;
  46.         i++;
  47.         n--;
  48.         m--;
  49.     }
  50. }
  51. }

Answered by: Abhijit Singh on: 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

Asked By: jitubaba10 | Asked On: Jan 30th, 2008

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

Answered by: ashoknaina on: 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...

Answered by: lavanyats on: 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.

Interface in c#

Asked By: dimplesharma | Asked On: Oct 14th, 2010

If the interface in c# only contains the declaration of the methods and we need to define those methods in the class, then why we use the interface..???

Answered by: TheOutlander on: Jan 2nd, 2011

Interfaces define a contract. You should use it only if you want to support a group or related functionalities in a class or struct. Otherwise there is no need to use it. Think about cars - they have ...

Command line arguments

Asked By: kichha | Asked On: Jul 28th, 2008

What is command line arguments?What are its uses?Where we have to use this?

Answered by: Abidullah on: May 21st, 2010

Command line arguments are used to provide input through console to the main function. The inputs values generally store into a string array (usually args[])Example:void main (String args[]){for ...

Answered by: abhishekrane on: Dec 9th, 2008

command line arguments are those which can be passed to the main method as parameters and use those values in the main method before executing it.

Programming approaches

Asked By: mesharat | Asked On: Nov 2nd, 2008

Explain and differentiate modular programming and structured programming approach?

Answered by: mundravijay on: Dec 7th, 2009

Programming approachesModular- In this approach we have some code that are implemented thru short of modules. We basically empasize on that modules and that modules are collectively form a program in ...

Storing character string

Asked By: Bhoomika sharma | Asked On: Oct 22nd, 2009

In a compiler there is 36 bit for a word and to store a character 8bits are needed. In this to store a character two words are appended. Then for storing a k characters string, how many words are neededa. 2k/9b. (2k+8)/9c. (k+8)/9d. 2*(k+8)/9e. None

Answered by: mundravijay on: Dec 7th, 2009

2k/9= 2*36/9=8 bits are needed for storing a character...

Static functions

Asked By: maheshbasavaraju | Asked On: Jul 9th, 2009

To which segment does static functions belong?

Answered by: madhusudhan.d.k on: Aug 12th, 2009

Static functions belongs to the stack segment.

Motion planning

Asked By: nsaliza4 | Asked On: Aug 6th, 2009

Motion planninga robot needs to visit an area of nxn squares. However, its movement is restricted to liner mobility. Additionally, it is not allowed to pass a square that poses an obstacle. The robot is allowed to visit the same square more than once. Count how many square the robot visited more...

First | Prev | | Next | Last Page

 

 

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Question Categories

Algorithm Questions

ColdFusion Interview Questions

Computer Awareness Questions

Delphi Interview Questions

Perl Interview Questions

PHP Interview Questions

Python Interview Questions

VBA Interview Questions

VoiceXML Interview Questions

XML Interview Questions

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.