Question

In: Computer Science

for C program 10 by 10 char array. char 0-9 as rows and char a-j as...

for C program 10 by 10 char array. char 0-9 as rows and char a-j as collumns.

Solutions

Expert Solution

//C code

#include<stdio.h>
#include<conio.h>

int main()
{

   char array[10][10];
   //ASCII Value of 0
   int asciiNum = 48;
   //ASCII value of a

   for (int i = 0; i < 10; i++)
   {
       array[i][0] = asciiNum;
       int asciiLetter = 97;
       for (int j = 0; j < 10; j++)
       {
           if (i == 9)
               break;
           array[j][i+1] = asciiLetter;
           asciiLetter++;
       }
       asciiNum++;
   }
   //print
   for (int i = 0; i < 10; i++)
   {
       for (int j = 0; j < 10; j++)
       {
           printf("%c ", array[i][j]);
       }
       printf("\n");
   }
   //pause
   _getch();
   return 0;
}

//Output

//If you need any help regarding this solution ......... please leave a comment ......... thanks


Related Solutions

C++ PROGRAM (Pointers and char arrays) IMPORTANT NOTES: 1. CHAR ARRAY MUST BE USED. 2. YOU...
C++ PROGRAM (Pointers and char arrays) IMPORTANT NOTES: 1. CHAR ARRAY MUST BE USED. 2. YOU MUST USE POINTERS. 3. YOU MUST USE THE SWITCH STATEMENT TO EXECUTE THE PROGRAM. 4. ALL MODIFICATIONS MUST BE DONE IN THE SAME ORIGINAL CHAR ARRAY WITHOUT CREATING A NEW ONE. Write a C++ program that modifies a null teminated char array as follows: Consonants are positioned at the beginning of the string and vowels are moved to the end of the string. Example...
Translate the following C++ program to Pep/9 assembly language. const char chConst = '+'; char ch1;...
Translate the following C++ program to Pep/9 assembly language. const char chConst = '+'; char ch1; char ch2; int main() { cin.get(ch1); cin.get(ch2);    cout << ch1 << chConst << ch2;    return 0; }
Question 2. Write a complete C++ program that uses a 2-dimensional array with 4 rows and...
Question 2. Write a complete C++ program that uses a 2-dimensional array with 4 rows and 30 columns. Row represents sections of a course and column represents the students, value inside each position of the array is the final exam grade for each students. Fill the array with random numbers between 40 and 100. Calculate the total, average, maximum, minimum for each section. Please do it simple. code
C Implement the function Append (char** s1, char** s2) that appends the second character array to...
C Implement the function Append (char** s1, char** s2) that appends the second character array to the first, replaces the first array with the result and replaces the second character array with the original first array. For example, if the first character array is "hello" and the second is "world" at the end of the function the new value of the first character array should be"helloworld" and the second array should be "hello". If the input is invalid the function...
c program //the file's size in bytes unsigned int fileSize(const char* name){     return 0; }...
c program //the file's size in bytes unsigned int fileSize(const char* name){     return 0; } //same as fileSize except if the file is a directory then it recursively finds the size of directory and all files it contains unsigned int fileSizeRec(const char* name){     return 0; }
C programming. Write a program that prompts the user to enter a 6x6 array with 0...
C programming. Write a program that prompts the user to enter a 6x6 array with 0 and 1, displays the matrix, and checks if every row and every column have the even number of 1’s.
c++ language Create a file program that reads an int type Array size 10; the array...
c++ language Create a file program that reads an int type Array size 10; the array has already 10 numbers, but your job is to resize the array, copy old elements of array to the new one and make it user input and add an additional 5 slots in the array, and lastly do binary search based on user input. close the file.
A 1.98  10-9 C charge has coordinates x = 0, y = −2.00; a 3.09  10-9 C charge...
A 1.98  10-9 C charge has coordinates x = 0, y = −2.00; a 3.09  10-9 C charge has coordinates x = 3.00, y = 0; and a -5.10  10-9 C charge has coordinates x = 3.00, y = 4.00, where all distances are in cm. Determine magnitude and direction for the electric field at the origin and the instantaneous acceleration of a proton placed at the origin (a) Determine the magnitude and direction for the electric field at the origin (measure the...
A 2.08  10-9 C charge has coordinates x = 0, y = −2.00; a 3.30  10-9 C charge...
A 2.08  10-9 C charge has coordinates x = 0, y = −2.00; a 3.30  10-9 C charge has coordinates x = 3.00, y = 0; and a -5.10  10-9 C charge has coordinates x = 3.00, y = 4.00, where all distances are in cm. Determine magnitude and direction for the electric field at the origin and the instantaneous acceleration of a proton placed at the origin. (a) Determine the magnitude and direction for the electric field at the origin (measure the...
Program in C: Write a program in C that reorders the elements in an array in...
Program in C: Write a program in C that reorders the elements in an array in ascending order from least to greatest. The array is {1,4,3,2,6,5,9,8,7,10}. You must use a swap function and a main function in the code. (Hint: Use void swap and swap)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT