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

3Sum - Leetcode solution - How i turned into two-pointer approach?

  class Solution {     public List < List < Integer >> threeSum ( int [] nums ) {         Arrays . sort (nums); // first sort...