. 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
write a program to convert temperature from fa height into celcius and vise versa,use modular programming
Definition of priority queue was given. We have to implement the priority queue using array of pointers with the priorities given in the range 1..n. The array could be accessed using the variable top. The list corresponding to the array elements contains the items having the priority as the array index. Adding an item would require changing the value of top if it has higher priority than top. Extracting an item would require deleting the first element from the corresponding queue. The following class was given: class PriorityQueue { int *Data[100]; int top; public: void put(int item, int priority); // inserts the item with the given priority. int get(int priority); // extract the element with the given priority. int count(); // returns the total elements in the priority queue. int isEmpty(); // check whether the priority queue is empty or not. }; We had to implement all these class functions.
How can I Draw an ellipse in 3d space and color it by using graph3d?
write a function that allocates memory for a single data type passed as a parameter.the function uses the new operator and return a pointer to the allocated memory.the function must catch and handle any exception during allocation
write a program to perform generic sort in arrays?
How to Split Strings with Regex in Managed C++ Applications?
write a program that reads a series of strings and prints only those strings begging with letter "b"
write a program to calculate the amount of investment after a period n years if the principal investors was p and interest is calculated using compound interest,formular=a=p(1+r)^n
Question 1: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date. *This Should Be Done IN C++
write a program using virtual function to find the transposing of a square matrix?
What output does the following code generate? Why? What output does it generate if you make A::Foo() a pure virtual function? class A { A() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; class B : public A { B() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; int main(int, char**) { A objectA; B objectB; return 0; }
Write a simple encryption program using string function which apply the substitution method.
A suduco given & u hv 2 check if it is incomplete(blanks left),or correct or incorrect
Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)
how to write a program that opens a file and display in reverse order?