plz answer.... write a program that reads line (using
getline) e.g."345", converts each line to an integer
using "atoi" and computes the average of all the numbers
read. also compute the standard deviation.
plz answer....A program that takes 3 variables e.g a,b,c in
as seperate parameters and rotates the values stored so
that value goes a to b, b to c and c to a .
number 2 plssssss help !!....using array.. turbo c..
create a program that will accept a number and determine if
it is a happy number or an unhappy number..
example:
enter a number : 7
7*7=49
then 4 and 9
4*4 and 9*9== 16 + 18 gives you 97
then 9 and 7
9*9 and 7*7 == 81 + 49 gives you 130
then 1 and 3
1*1 and 3*3 == 1 + 9 gives you 10
1*1 gives you 1
sample output:
7= 49= 16+81= 97= 81+49=130 =1+9=10 =1
"7 is a happy number"
. if the last number is 2 then the number being inputed is
not a happy number.
plssssss help !!....using array.. turbo c..
create a program that will accept number of words to be
consored.
.a word must not exceed 10 characters long
.the text to be entered will be no longer than 200 characters
.there will be no 10 words
example:
enter number of words to be censor: 5
enter words to censor:
windows
office
microsoft
bill
gates
enter text to censor:
bill gates founded microsoft and makes office and windows
sample output:
<consored> <censored> founded <censored> and makes
<censored> and <censored>
Write a program that accepts a string where multiple spaces
are given in between the words. Print the string ignoring
the multiple spaces.
Example:
Input: “ We Are Student “
Output: "We Are Student"
62
a number is perfect if it is equal to the sum of its proper
divisor..
6 is perfect number coz its proper divisors are 1,2 and
three.. and 1+2+3=6...
a number is deficient if the sum of its proper divisor is
less than the number..
sample: 8 is deficient, coz its proper divisors are 1,2 and
4, and 1+2+4=7.
abundant number, if the sum of its proper divisor is greater
than the number..
sample..12 is abundant coz 1+2+3+4+6=16 which is geater than 12.
now write a program that prompts the user for a number, then
determines whether the number is perfect,deficient and
abundant..
17
how to impliment 2 or more stacks in a single dimensional
array ?
a) Identify the following declarations.
Ex.
int i
(integer variable) float a[l0](array of 10 real nos)
int (*f())()
void *f
int (*f()) []
void *f
int f[] [] []
char *(*f) ()
int (*f[]) []
float(*f) [] []
float **f
int ******f
1. Duplicate the even numbers. -1
Sample I/O
Array1:- 4,2,24,3,22
Updated Array:- 4,4,2,2,24,24,3,22,22
2. Reverse the array in a region - 1
Sample I/O
Array1:- 4,2,24,3,22,41,21
Enter Region:- 2,5
Update Array:-4,41,22,3,24,2,21
3. Store first the even digits in an array and then odd
digits in same array -2
Sample I/O
Array1:- 4,2,24,3,22,41,21
Array 2:- 4,2,2,4,2,2,4,2,3,1,1
4. Store the count of the digits in all numbers in an array
and print the count. -2
Sample I/O
Array1:- 4,2,9,3,7,41,28
Array 2:- 0,1,1,1,2,0,0,1,1,1
1-1;2-1;3-1;4-2;7-1;8-1;9-1
5. Store all palindrome numbers in to another array -2
Sample I/O
Array1:- 4,22,9,313,7,141,28
Array 2:- 4,22,9,313,141
6. Arrange the array in such a way that odd numbers come
first and then even numbers -1
Sample I/O
Array1:- 4,22,9,313,7,141,28
Update Array1:- 9,313,7,141,4,22,28
7. Store into another array by inserting it in the right
place - 2
Sample I/O
Array1:- 4,22,9,313,7,141,28
Array2:- 4 /4,22 /4,9,22 /4,9,22 ,313 /4,7,9,22 ,313
/4,7,9,22 ,141,313 /
4,7,9,22,28 ,141,313
8. Merge two sorted arrays in a sorted fashion - 3
Sample I/O
Array 1:- 3,6,7,9,11,16
Array 2:- 1,2,5,7,20
Array 3:- 1,2,3,5,6,7,9,11,16,20
9. Upadte the array so that an array element is followed by
its revere - 1
Sample I/O
Array 1:- 13,63,74,9,11,16
Updated Array 1:- 13,31,63,36,74,47,9,9,11,11,16,16
10.Spread the digits of the array in the same array. -1
Sample I/O
Array 1:- 13,63,74,9,11,16
Updated Array 1:-1,3,6,3,74,9,1,1,1,6
11.Shift the boundary of array to have only 2 digit numbers.
Sample I/O
Array 1:- 139,643,74,9,101,126
Updated Array 1:- 13,96,43,74,91,11,26
12.Print the largest occuring digit in an array of N numbers.
Sample I/O
Array 1:- 13,63,74,9,11,16
1 occurs most.