![]() In this case, we have given 5 spaces between two letters. ![]() In this case, we put write(‘ ‘) to print the space between two letters that are m,n, because when we write commands one after the other then it will automatically print one after the other means it will not take space so that we need to tell prolog to print space as ‘write(‘ ‘)’. ![]() In this case, we can say that prolog allow to writes two ‘write’ commands one after the other and the output is continuous, which means it will not take space or comma automatically. Let us see how to use two write/1 commands in prolog, ![]() This is a case where we can give values to the term, here we given the value to the E and that will also be shown in the output because it contains the variable. Now we will see when it will returns the contains variables,Īs above when we call the variable it will return the contains variable with its value prefix with _(underscore). If we want elements to be arranged in a user-friendly format then we can follow the above examples as per the needs. The above query will give output as shown above. The working of built-in predicate write/1 is as following, it taking terms and that will print on the screen with user-friendly notations so that user can understand it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |