Question 1 Write C statements that prints “Male” if gender variable contains ‘M’ and prints “Female” if it contains ‘F’ otherwise it prints “Wrong Input”. Here gender variable is a character variable. Questions 2 For the given struct FOO create an array of 3 elements. Get values from the user and print them on the screen. Calculate and print sum of data member var for each array element. Just write the statements would be performing the asking tasks. struct FOO { char ch[20]; double var[5]; }; Question 3 Suppose we have an integer (4 Bytes) 2D array of 5×6 elements\Dimensions. Write a function which receives this array and print the sum of all the elements in third row?

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.3: Declaring And Processing Two-dimensional Arrays
Problem 7E: (Electrical eng.) a. An engineer has constructed a two-dimensional array of real numbers with three...
icon
Related questions
Question

Use only C language.

Question 1

Write C statements that prints “Male” if gender variable contains ‘M’ and prints “Female” if it contains ‘F’ otherwise it prints “Wrong Input”. Here gender variable is a character variable.

Questions 2
For the given struct FOO create an array of 3 elements. Get values from the user and print them on the screen. Calculate and print sum of data member var for each array element. Just write the statements would be performing the asking tasks. struct FOO { char ch[20]; double var[5]; };
Question 3
Suppose we have an integer (4 Bytes) 2D array of 5×6 elements\Dimensions. Write a function which receives this array and print the sum of all the elements in third row?
Expert Solution
steps

Step by step

Solved in 3 steps with 8 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,