Question: Write a C program that uses a function with a static (storage class) local variable to print out an asterisk character (*) and a space

Write a C program that uses a function with a static (storage class) local variable to print out an asterisk character (*) and a space character for each time it was called. For example, the following loop would print the output shown below it.

int i; for(i = 0; i < 3; i++) howmany(); 
* * * * * * 

I did it like the bellow code but my instructor said " No!, this is wrong. The assignment was to write a function that used a static local variable"

#include

int main(void) {

int i,j;

for(i=1;i<=3;i++) { for(j=0;j

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!