. Remove all the blank spaces between
character.Matrix is of 10* 10.
eg: INPUT
------------------------------------
| N | A | | V | |T
-------------------------------------
| |G | U | |P |
--------------------------------------
|T | | | A | |
------------------------------------
OUTPUT:
------------------------------------
| N | A | V | T | |
-------------------------------------
|G |U | P | | |
--------------------------------------
|T | A | | | |
------------------------------------

Answer Posted / indrasen singh

follow these steps..
a) Create 10 by 10 matrix of char array and fill with '|'

b) Now in a loop check your first matrx whether it have alphabet character if found then insert it into the new matrix in the desired position....

char str1[10][10] // suppose it contains your data
char str2[10][10] //it store result

int i,j;

for(i=0;i<10;i++)
for(j=0;j<10;j++)
str2[j]='|';

int charfound;

for(i=0;i<10;i++)
{
charfound=0;
for(j=0;j<10;j++)
{
if(isalpha(str1[j]))
{
charfound++;
str2[((charfound*2)-1)]=str1[j];
}
}
}

Is This Answer Correct ?    1 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

can you please write a program for deadlock that can detect deadlock and to prevent deadlock.

2748


output for printf("printf");

1985


Code for Method of Handling Factorials of Any Size?

2007


write a program that creates a sequenced array of numbers starting with 1 and alternately add 1 and then 2 to create the text number in the series , as shown below. 1,33,4,6,7,9,............147,148,150 Then , using a binary search , searches the array 100 times using randomly generated targets in the range of 1 to 150

3269


Ask the user to input three positive integers M, N and q. Make the 2 dimensional array of integers with size MxN, where all the elements of I (I = 1,…,M) line will be members of geometrical progression with first element equal to the number of line (I) and denominator q.

3397






write a program that reads a series of strings and prints only those strings begging with letter "b"

2674


write a program to perform generic sort in arrays?

2630


Write a (n) algorithm that sorts n distinct integers, ranging in size between 1 and kn inclusive, where k is a constant positive integer. (Hint: Use a kn-element array.)

4453


how to take time as input in the format (12:02:13) from user so that controls remains between these columns?

1821


how to diplay a external image of output on winxp by using c & c++,

2938


How to Split Strings with Regex in Managed C++ Applications?

3129


What output does this program generate as shown? Why? class A { A() { cout << "A::A()" << endl; } ~A() { cout << "A::~A()" << endl; throw "A::exception"; } }; class B { B() { cout << "B::B()" << endl; throw "B::exception"; } ~B() { cout << "B::~B()"; } }; int main(int, char**) { try { cout << "Entering try...catch block" << endl; A objectA; B objectB; cout << "Exiting try...catch block" << endl; } catch (char* ex) { cout << ex << endl; } return 0; }

580


solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)

2937


3. Program to find the Sum of give series. a. (1)+(1+2)+(1+2+3)+(1+2+3+4)+……………………………….. b. 1/1+1/9+1/25+1/49+……………...

4355


Code for Two Classes for Doing Gzip in Memory?

2814