Home > Back-end >  New consult about C return values
New consult about C return values

Time:12-23

I just want to output to output graphics don't want to back the 5 do consult

 # include 
Int the pattern (int) p {
Int o;
Int m;
For (o=0; O & lt; p; O++) {
For (m=0; M & lt;=o; M++) {
printf("*");
}
printf("\n");
}
}
Int main () {
int a;
Char b;
Printf (" enter data \ n ");
Scanf_s (" % d ", & amp; A);
B=the pattern (a);
Printf (" % d ", b);

}

CodePudding user response:

 # include 
Int the pattern (int) p {
Int o;
Int m;
For (o=0; O & lt; p; O++) {
For (m=0; M & lt;=o; M++) {
printf("*");
}
printf("\n");
}
}
Int main () {
int a;
Char b;
Printf (" enter data \ n ");
Scanf_s (" % d ", & amp; A);
B=the pattern (a);
//printf (" % d ", b);

}

CodePudding user response:

Because of you the pattern function of the return value is of type int, so b=the pattern (a); Execution after b is assigned a integer, your function has been output * graphics, don't have to reinvent the wheel and then print (" % d ", b); Code change is upstairs in that way, just delete this line,
  • Related