C exercise

lic

Joined
Feb 3, 2022
Messages
1
Reaction score
0
how would you write these exercises in C language? i have some problems with them

1)having a two-dimensional array A [100] [100], initialize A [j] = i * j, then print the sum and product of all elements and put in another array B the maximum of each row. Then find the sum of all the odd numbers.

2)a program that creates an array of structures where each structure contains a number and a pointer pointing to the next location in the array

3)a program that reads characters from a text file and prints only those that repeat and how many times they repeat

4)program that reads integers from files and puts them in arrays

5)read characters from a file and print the sum of odd values

6)given two 3-index arrays, add them and put the result in a third 3-index array
 
Joined
Feb 6, 2022
Messages
2
Reaction score
0
1) You need to be precise. You want the sum of all 10,000 elements, or the sum adjacent elements, or all elements in a row, or what?
2) Arrays of structures can be created with declarations. https://onlinegdb.com/kzD1hTwux
3) Read a character, set count to 1. Save it. Read another character. If it is the same as the last character, increment the count. If not and and count==1, save new character. If count > 1, print saved character and count, and save new character and reset count.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,913
Messages
2,570,027
Members
46,421
Latest member
WaylonBran

Latest Threads

Top