|
CS256 - Principles of Structured Design
Fall 2021
|
Displaying ./code/sternflCode/h5/scream.c
/*
p05.c - prompt the user for two numbers, representing the number of A's and the
number of H's, then print the specified number of A's followed by the
specified number of H's
*/
#include <stdio.h>
int main(){
int a, h; //declaring variables for a and h
//print a statement asking the user for number of A's
//then use scanf to get the number and store i
printf("How many A's should I print?> ");
scanf("%d", &a);
//do the same thing as above, but this time, you're asking for the number of H's
//then use a loop to print the specified number of A's
//Just print the uppercase A character, do NOT print a newline character
//then do the same as above, except we're now printing H's
//then after both loops finish, print a newline character("\n")
printf("\n");
return 0;
}
|