see the pattern .... INV:1<=i<=5 and u have printed ****1#####1 ****2####2 ****(6-i)times,i,####....(6-i)times,i loop { } assert: i = 6 and u have printed *****1#####1 ****2####2 ***3###3 **4##4 *5#5 INV ...it is called the ivariant it is a condition which is always satisfied at that point at every iteration assert:......it is what u can assertain that would have happened whaen the loop end and the control is transfered to that point and the INV is basicaly the weakening of assert: ......did u understand it........it is not any language in comp sci but it is the language of the algorithm...........the C++ or java or python...what ever.......are just a matter of syntax....... what u really have to learn is this, once u have done this.....then u can say that u have learnt programming
u can take the positions as 1st row 5th column,,,,n use the for loop with cout <<(the symbol u want to display)...u have to use a nested if else loop also...this program is nt easy....
see the pattern ....
INV:1<=i<=5 and u have printed
****1#####1
****2####2
****(6-i)times,i,####....(6-i)times,i
loop
{
}
assert: i = 6 and u have printed
*****1#####1
****2####2
***3###3
**4##4
*5#5
INV ...it is called the ivariant it is a condition which is always satisfied at that point at every iteration
assert:......it is what u can assertain that would have happened whaen the loop end and the control is transfered to that point
and the INV is basicaly the weakening of assert: ......did u understand it........it is not any language in comp sci but it is
the language of the algorithm...........the C++ or java or python...what ever.......are just a matter of syntax.......
what u really have to learn is this, once u have done this.....then u can say that u have learnt programming