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 to calculate the sum of the rows and the columns in a multidimensional array
c++ program to calculate the sum of the rows and the columns in a multidimensional array
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; }
Translate the following C program to Pep/9 assembly language: #include <stdio.h> char toLower(char ch) { if...
Translate the following C program to Pep/9 assembly language: #include <stdio.h> char toLower(char ch) { if (ch >= 'A' && ch <= 'Z' )        ch += 'a' - 'A'; return ch; } int main() { char ch, conversion; printf("Enter an uppercase letter: "); scanf("%c", &ch); conversion = toLower(ch); printf("\nLetter after conversion: %c\n\n", conversion); return 0; }
Transfer in MIPS char * strtoupper(char s[]) { char c; c = s[0]; /* empty string...
Transfer in MIPS char * strtoupper(char s[]) { char c; c = s[0]; /* empty string */ if (c == 0) return s; /* convert the first character to upper case*/ if (c >= ‘a’ && d <= ‘z’) { c -= 32; s[0] = c; } /* convert the remaining characters*/ strtoupper(s + 1); return s; }
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...
Translate this algorithm to code on C compare(char array[ ]) word = split(array, " "); //gets...
Translate this algorithm to code on C compare(char array[ ]) word = split(array, " "); //gets the first word before the blank space if word == Hello { print("I am saying hello"); }else if (word == Bye) print("I am saying goodbye"); } Example--------------------- char array = "Hello Ana"; compare(array); char array1 = "Bye Ana" compare(array1); result "I am saying hello" "I am saying goodbye"
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.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT