Novice C language learning journey(9)

in Programming5 years ago (edited)

梦幻光晕蓝色背景矢量图.png
How to delete the content of outputted?I want to delete the content of '*' on console.I used the "\b" on the printf statement.But the code can not implement this function.Because it delete one line only.The code as follows:

   #include"stdio.h"
   #include"stdlib.h"
   #include"windows.h"
   #include"stdio.h"
   main(){
   int i,j,k;
   k=0;
   char a[2][2]={{'*','*'},{'*','*'}};  
   for(i=0;i<=1;i++){
         for(j=0;j<=1;j++){     
               printf("%c",a[i][j]);
   }
  if(k>=1)
    ;
    else
        printf("\n");
  k++;
  }
  Sleep(2000);
  printf("\b\b\b\b    \n");
  system("pause");
  }

No long after,I found it can implement the function when added the statement of "system("cls")".The modified as follows:

  #include"stdio.h"
  #include"stdlib.h"
  #include"windows.h"
  #include"stdio.h"
  main(){
  int i,j,k;
  k=0;
  char a[2][2]={{'*','*'},{'*','*'}};  
  for(i=0;i<=1;i++){
        for(j=0;j<=1;j++){     
              printf("%c",a[i][j]);
  }
  if(k>=1)
    ;
    else
        printf("\n");
  k++;
  }
  Sleep(2000);
  printf("\b\b\b\b    \n");
  Sleep(2000);
  system("cls");
  system("pause");
  }
Sort:  

According to the Bible, God is everywhere: Fact or Fiction.

Watch the Video below to know the Answer...

(Sorry for sending this comment. We are not looking for our self profit, our intentions is to preach the words of God in any means possible.)


Comment what you understand of our Youtube Video to receive our full votes. We have 30,000 #SteemPower. It's our little way to Thank you, our beloved friend.
Check our Discord Chat
Join our Official Community: https://steemit.com/created/hive-182074

Congratulations @sky-999! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You received more than 100 upvotes. Your next target is to reach 250 upvotes.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

Use your witness votes and get the Community Badge
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

It's great seeing your progress. Wishing you the best success.

Thanks for posting in the #programming community. Upvoted.