Question: Overview In this assignment, the student will use primitive variable contents in the display of a nonsensical story to demonstrate output formatting concepts. When completing

Overview

In this assignment, the student will use primitive variable contents in the display of a nonsensical story to demonstrate output formatting concepts. When completing this assignment, the student should demonstrate mastery of the following concepts:

Variable Initializations

printf() Statements

Conversion Characters

Escape Sequences

Multi-line Source Code Formatting

Assignment

Write a C program that display the following story based on the values in each variable. Start your program with the following shell:

#include

int main() {

// declare and initialize variables

char name[30];

char dogName[30];

int age;

long favNum;

double favDec;

// display story

return 0;

}

Your program should use the variables to display name, dogName, age, favNum, and favDec throughout the program where appropriate

.Make sure you also write code to initialize the variables to valid constant values on the same line as the declaration. Write a series of printf() statements that print out the following story exactly as it is shown below:

Overview In this assignment, the student will use primitive variable contents in

CN. ":\users\markie\desktoplwork stuff\spr09\cis 221 (01)\b - weekly assignments\pra Hello, my name is Hamid. "C:\users\m As I'm sure you already know, my best friend is a dog His name is "Alex"... can you say "Alex"? I know it's quite pathetic for a man of 56 years to have a dog as a best friend, but I can't really help it. You see, I have terrible hygiene and don't really have much luck with the ladies. It probably doesn't help that I insist on "impressing" them with my god-given talent to convert base-10 numbers to octal and hexadecimal. For instance, my favorite number 34 is 42 in octal. If I took that same number and converted it to hexadecimal, it would be 22. My favorite decimal is 8.90, but I can't seem to convert that one into octal or hexadecimal. I'm pretty sure you can do it, but I'm not 100. sure. Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!