Posts

Showing posts from June, 2022

What is programming language?

Image
                                                              PROGRAMMING  LANGUAGE What is programming language in simple word? A programming language is a Vocabulary and set a grammatical rules for instructing a computer or computing device to perform specific tasks.  The term programming language usually refers to high-level language, such as BASIC, C, C++, COBOL, Java, FORTRAN, Ada, and Pascal. Before Learning any language , it is important to know about the various types of languages and their features. It is interesting to know what were the basic requirements of the programmers and what difficulties they faced with the existing language. The programming languages can be classified into two types :- 1.) Low level languages. 2.)High level languages. Low level languages The  languages in this category are the m...

7.) program to convert any number(in digit) into word.

/* program to convert any number(in digit) into word. for example : 4 3 2 0            Four Three Two zero*/ #include <stdio.h> #include <conio.h> int main () {     int num , i , rev = 0 , rem ;     printf ( "Enter the number : \n " );     scanf ( " %d " , & num );     while ( num != 0 ) // loop for find reverse of the number.     {         rem = num % 10 ;         rev = rev * 10 + rem ;         num /= 10 ;     }     num = rev ;     while ( num != 0 )     {         rem = num % 10 ;         num /= 10 ;         switch ( rem )         {         case 0 :             printf ( "Zero \t " );             break ;   ...

6.) Write a program using switch case statement for following option.

  // program using switch case statement for following option: // a) factorial of a number. // b) prime or not // c) Odd or Even // d) exit #include <stdio.h> #include <conio.h> #include <stdlib.h> int main () {     char ch ;     int num , i ;     while ( 1 )     {         int fact = 1 ;         printf ( "Enter the choice where a) calculate the factorial of a number, b) check the number is prime or not , c) odd or even ,d) exit : \n " );         scanf ( " %c " , & ch );         switch ( ch )         {         case 'a' :             printf ( "Enter the number : \n " );             scanf ( " %d " , & num );             for ( i = 1 ; i <= num ; i ++)       ...

5 j.) Program to print : -

  /* program to print      *     ***    *****   *******  *********  */ # include <stdio.h> int main () {     int i , j , k ;     for ( i = 1 ; i <= 5 ; i ++)     {         for ( j = 5 ; j >= i ; j --)         {             printf ( " " );         }         for ( k = 1 ; k <= 2 * i - 1 ; k ++)         {             printf ( "*" );         }         printf ( " \n " );     }     return 0 ; } Output :- * *** ***** ******* ********* ****** Thank you ******

5 i .) program to print:-

  /* program to print *   *   *   *   *   *   *   *   * *   *   *   *   * * */ # include <stdio.h> int main () {     int i , j ;     for ( i = 0 ; i < 5 ; i ++)     {         for ( j = 5 ; j > i ; j --)         {             printf ( "* " );         }         printf ( " \n " );     }     return 0 ; } Output :- * * * * * * * * * * * * * * * ###### Thank you ######