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.1: One-dimensional Arrays
Problem 10E: (Electrical eng.) Write a program that specifies three one-dimensional arrays named current,...
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
  • SEE MORE 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
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
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning
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 with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning