Question

C PROGRAMMING      Write a printf or scanf statement for each of the following: a) Print...

C PROGRAMMING

     Write a printf or scanf statement for each of the following:

a) Print unsigned integer 2001 right justified in a 12-digit field with 6 digits.

b) Print 3.150 in a 9-digit field with preceding zeros.

// part of my answer: Printf(“%09

c) Read a time of the form hh-mm-ss, storing the parts of the time in the integer variables hour, minute and second. Skip the dash (-) in the input stream. Use the assignment suppression character.

d) Read a string of the form "characters" from the standard input. Store the string in character array s. Eliminate the quotation marks from the input stream.

e) Read a time of the form hh:mm:ss, storing the parts of the time in the integer variables hour, minute and second. Skip the colons (:) in the input stream. Do not use the assignment suppression character.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answers: a,b,c

OUTPUT:

Answers: d

Answer : e

Add a comment
Know the answer?
Add Answer to:
C PROGRAMMING      Write a printf or scanf statement for each of the following: a) Print...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • this is in C programming language 1. Write a printf or scanf statement for each of...

    this is in C programming language 1. Write a printf or scanf statement for each of the following: a) Print unsigned integer 1001 right justified in a 10-digit field with 5 digits. b) Read a hexadecimal value into variable hex. c) Print 300 with and without a sign. .d) Print 200 in hexadecimal form preceded by Ox. e) Read characters into array m until the letter z is encountered. f) Print 7.350 in a 7-digit field with preceding zeros. B)...

  • Write in C Spring 2016 Lab Assignment 11 ET2100 In computer programming in general a "string"...

    Write in C Spring 2016 Lab Assignment 11 ET2100 In computer programming in general a "string" is a sequence of characters. In the C language anything within double quotes is a "string constant" so you have been seeing strings all semester. But we can also have string variables. In the C language these are implemented as an array of char, e.g. char name (10]: In order to make these variables easier to work with, it has been universally agreed that...

  • Write a program that implements an elementary bit stream cipher. An elementary level bit stream cipher...

    Write a program that implements an elementary bit stream cipher. An elementary level bit stream cipher is an encryption algorithm that encrypts 1 byte of plain text at a time. This one uses a given 4-bit bit pattern as the key. The size of the encrypted message that we want to be able to send has a maximum length of 200 characters. You must: 1. prompt the user to input the clear text to be encrypted. You must use printf()...

  • C- PROGRAMMING PROJECT #4 Design and Write a C program to calculate an average of an...

    C- PROGRAMMING PROJECT #4 Design and Write a C program to calculate an average of an array of numbers and produce the following output: 1. Your first and last name 2. Course Number 3. C Project Number 4. All the numbers in the array 5. The sum of all the numbers in the array 6. The count of all the numbers in the array 7. The average of all the numbers in the array Double-space after lines 3, 4, 5,...

  • Programming Assignment #2 EE 2372 MAKE SURE TO FOLLOW INSTRUCTIONS CAREFULLY, IF YOU HAVE ANY DOUBTS...

    Programming Assignment #2 EE 2372 MAKE SURE TO FOLLOW INSTRUCTIONS CAREFULLY, IF YOU HAVE ANY DOUBTS PLEASE EMAIL ME! This programming assignment will just be a small extension to programming assignment 1. In the first assignment each of the functions could only take a predefined number of inputs. This time the objective is to be able to complete these functions with any amount of inputs. The user will pass arguments through the command line (this means you will have to...

  • Need this in C The starter code is long, if you know how to do it...

    Need this in C The starter code is long, if you know how to do it in other way please do. Do the best you can please. Here's the starter code: // ----------------------------------------------------------------------- // monsterdb.c // ----------------------------------------------------------------------- #include #include #include // ----------------------------------------------------------------------- // Some defines #define NAME_MAX 64 #define BUFFER_MAX 256 // ----------------------------------------------------------------------- // Structs typedef struct { char name[NAME_MAX]; int hp; int attackPower; int armor; } Character; typedef struct { int size; Character *list; } CharacterContainer; // ----------------------------------------------------------------------- //...

  • In C code 1. Write and submit the algorithm OR flowchart to indicate you understand the...

    In C code 1. Write and submit the algorithm OR flowchart to indicate you understand the problem 2. Create a project and name the source code lastname_firstname_prog5.c 3. Use the prog5.c as a guide, copy/ paste into your project source code *** build run and test, the outline code - You will need to declare an integer variable called again and initialize it 4. Add the function prototype and implement the function definition for the Greeting function 5. Add the...

  • Please help me with the following C Programming project. I am providing the code I used...

    Please help me with the following C Programming project. I am providing the code I used which needs to be reworked to add the following requirements. Here is my code #include<stdio.h> char input; int main() { int i = 0; while (true){ scanf_s("%c", &input); if (input == 'X') break; printf("%c", input); } return 0; } Here are the requirements for the code plus and additional note what the code should have. Goals Understand the ASCII representation of character values. Understand...

  • Programming Assignment 1 Write a class called Clock. Your class should have 3 instance variables, one...

    Programming Assignment 1 Write a class called Clock. Your class should have 3 instance variables, one for the hour, one for the minute and one for the second. Your class should have the following methods: A default constructor that takes no parameters (make sure this constructor assigns values to the instance variables) A constructor that takes 3 parameters, one for each instance variable A mutator method called setHour which takes a single integer parameter. This method sets the value of...

  • This is for C++ Write a program that reads in a sequence of characters entered by...

    This is for C++ Write a program that reads in a sequence of characters entered by the user and terminated by a period ('.'). Your program should allow the user to enter multiple lines of input by pressing the enter key at the end of each line. The program should print out a frequency table, sorted in decreasing order by number of occurences, listing each letter that ocurred along with the number of times it occured. All non-alphabetic characters must...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT