Pages

Tuesday, January 14, 2025

Write a program to print multiplication table of 10 in reversed order. in C Language

 My mistakes:-

1. couldn't figure out CONDITION. just i ( ZERO OR NONE)


// Write a program to print multiplication table of 10 in reversed order.
#include <stdio.h>

int main()
{
    int n;
    scanf("%d", &n);
    for( int i = 10; i ; i--) // for(initialize; conditon; increment or decrement)
    {
        printf("%d x %d = %d\n", n, i, n*i);
    }

   
    return 0;

}

No comments:

Post a Comment

remove duplicates from sorted array - two pointer approach (leetcode)

  class Solution {     public int removeDuplicates ( int [] nums ) {         // base case: return if array have no el.         if ( nums...