Posts

Showing posts from February, 2022

Reverse multiplication table

  #include <stdio.h> int main (){ printf ( "The multiplication table of 10: \n\n " ); for ( int i = 10 ; i ; i --) {     printf ( "10* %d = %d \n " , i , 10 * i ); }   return 0 ; }

Print first n natural numbers

  #include <stdio.h> int main (){ int i = 1 ; int n ; printf ( "Enter the number of natural numbers you want to print \n " ); scanf ( " %d " ,& n ); printf ( "The n natural numbers are: \n " ); do {   printf ( " %d \n " , i );   /* code */   i ++; } while ( i <= n );   return 0 ; }

print 10 natural number from 10-20

  #include <stdio.h> int main () {     int i = 0 ;         printf ( "The 10 natural numbers between 10 and 20 are:" );     while ( i < 10 )     { int a = 10 ;                 i ++;         a = a + i ;         printf ( " %d \n " , a );     }     return 0 ; }