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

3917. Count Indices With Opposite Parity (Brute Force) O(n2) + Optimized Solution O(n) + tips LEETCODE WEEKLY 500

  class Solution {     public int [] countOppositeParity ( int [] nums ) {          // approach 1 - checks every pair         int n = n...