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.
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...
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...
456 sum is 15
Code
int 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(); }
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...
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...
Hi guys , in C++ programming (if) when we use "=" isntead of "==" compiler behave the same ... Do u know why compiler behave like this ?? tnx
in the first if condition want to place double equal.then it will treat as condition.otherwise it will treat as declaration
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.";
}
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.
"c #include main() { int n, sum = 0, remainder; printf("Enter an integer "); scanf("%d",&n); while(n != 0) { remainder = n % 10; sum = sum + remai...
"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
What are the advantages and dis-advantages of real time, timer sharing and batch processing?
Tell about shell aritmetic operators and functions.
There are following shell operators
Arithmetic Operators.
Relational Operators.
Boolean Operators.
String Operators.
File Test Operators.
What are the attributes of samba?
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.
here
Code
1 public class Utility 2 { 3 public Utility() 4 { 5 InstanceCount++; 6 } 7 8 public static int InstanceCount; 9 }
How to write spiral matrix program?
Code
#include<stdio.h> main() { int a[20][20],i,j,n,m,p,q,k=0; 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++) { k++; } j--; i++; for(;i<=m && k<p*q;i++) { k++; } i--; j--; for(;j>=i-m+1 && k<p*q;j--) { k++; } j++; i--; for(;i>1 && k<p*q;i--) { k++; } if(k<p*q) { j++; i++; n--; m--; } } }
/*~~~~~~~~~ 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 ...
Why the programing language are case sensitive as is not for user friendly.
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...
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.
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..???
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 ...
What is command line arguments?What are its uses?Where we have to use this?
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 ...
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.
Explain and differentiate modular programming and structured programming approach?
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 ...
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
2k/9= 2*36/9=8 bits are needed for storing a character...
To which segment does static functions belong?
Static functions belongs to the stack segment.
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...
ColdFusion Interview Questions