+ 1
Write a program to print following patter
* * * * * * * * * * * * * * * using only four printf
2 Réponses
+ 6
Define a function to print 5 * symbols. We should use one printf in that. A call to this function would print first and last lines of the pattern. Use 3 printf statements for remaining 3 lines.
0
public class Star(){
for(int a=0; a<=5; a++){
printf("*");
}
}
public class main void(string[] args){
S object = new Star();
S.Star();
printf("*. *");
printf(". *. "):
printf("*. *");
S.Star();
}