Posts

Top 10 Programming Language to learn in 2023

Are you a programming enthusiast looking to stay ahead of the curve in 2023? With the ever-evolving tech landscape, keeping up with the Best Programming Language to learn can be a daunting task. Fear not, as we have compiled a list of the top 10 Programming Languages that you should consider learning in 2023. Python: This versatile language continues to dominate in 2023, with its ease of use, readability, and a vast library of modules. JavaScript: As web development grows increasingly popular, JavaScript remains a crucial player, with its ability to create dynamic and interactive web pages. Java: This language has stood the test of time and remains a popular choice for enterprise software development. C++: A staple in the gaming and systems development industries, C++ offers exceptional performance and memory management. Swift: Apple's preferred language for iOS app development, Swift continues to grow in popularity with its simplicity and reliability. R: As data science and machin...

C Program To Accept The String That Ends With 01 | C Programming

Image
C Program To Accept The String That Ends With 01 #include <stdio.h> #include <math.h> #include <string.h> int main () {     char s [ 100 ];     int i = 0 , q = 0 , l;     printf ( "Enter stringover {0,1}: \n " );         scanf ( " %s " ,s);     l = strlen (s);     for (i = 0 ; s [i] != ' \0 ' ; i++)     {         if ( s [i] == '0' && q == 0 )         {             if (i == (l - 2 ))                 q = 1 ;             else                 q = 0 ;         }         else if ( s [i] == '1' && q == 0 )             q = 0 ;         else if ( s [i] == '1' && q == 1 )       ...

C Program To Accept The String Starting With 01 | C Programming

Image
C Program To Accept The String Starting With 01 #include <stdio.h> #include <string.h> int main () {     char str [ 10 ];     int len, i, q = 0 ;     printf ( "enter the string which only contain 0 and 1 \n " );     scanf ( " %s " , str);     len = strlen (str);     for (i = 0 ; i <= len; i++)     {         if ( str [i] == '0' && q == 0 )             q = 1 ;         else if ( str [i] == '1' && q == 0 )             break ;         else if ( str [i] == '1' && q == 1 )             q = 2 ;         else if ( str [i] == '0' && q == 1 )             break ;         else if ( str [i] == '0' && q == 2 )         ...

C Program For Bubble Sort | C Programming

Image
C Program For Bubble Sort by Generating Random Numbers and Using time.h Function #include <stdio.h> #include <time.h> #include <stdlib.h> void bubble_sort ( int [], int ); int main () {     int list [ 100 ], n , i ;     time_t t ;     printf ( "Enter the max number \n " );     scanf ( " %d " , & n );     srand (( unsigned ) time (& t ));     for ( i = 0 ; i < n ; i ++)     {         list [ i ] = rand () % 100 ;     }     for ( i = 0 ; i < n ; i ++)     {         printf ( " %d \t " , list [ i ]);     }     bubble_sort ( list , n );     printf ( " \n\n Time taken to complete the bubblesort %u \n " , clock () / CLOCKS_PER_SEC);     printf ( " \n The sorted list is:" );     for ( i = 0 ; i < n ; i ++)         printf ( " %d \...

C Program To Accept The String Having Length At Least Two | C Programming

Image
C Program To Accept The String Having Length At Least Two #include <stdio.h> #include <string.h> int main () {     char str [ 10 ];     int len, i, q = 0 ;     printf ( "Enter the string which only contain a and b \n " );     scanf ( " %s " , str);     len = strlen (str);     for (i = 0 ; i <= len; i++)     {         if ( str [i] == 'a' && q == 0 )             q = 1 ;         else if ( str [i] == 'b' && q == 0 )             q = 1 ;         else if ( str [i] == 'a' && q == 1 )             q = 2 ;         else if ( str [i] == 'b' && q == 1 )             q = 2 ;         else if ( str [i] == 'a' && q == 2 )      ...

Bubble Sort

Image
Bubble Sort Bubble sort is a very simple sorting technique. However, this sorting algorithm is not efficient in comparison to other sorting algorithms. The basic idea underlying the bubble sort is to pass through the file sequentially several times. Each pass consists of comparing each element in the file with its successor (x[i] with x[i+1]) and interchanging the two elements if they are not in proper order. Example: Consider the following file, 25          57          48          37          12          92          86          33 In first pass, following comparisons are made: x[o] with x[1] (25 with 57) No interchange x[1] with x[2] (57 with 48) Interchange x[2] with x[3] (57 with 37) Interchange x[3] with x[4] (57 with 12) Interchange x[4] with x[5] (57 with 92) No interchange x[5] ...

C Program To Accept The String Having Even Length | C Programming

Image
C Program To Accept The String Having Even Length #include <stdio.h> #include <string.h> int main () {     char str [ 10 ];     int len, i, q = 0 ;     printf ( "Enter the string which only contain 0 and 1 \n " );     scanf ( " %s " , str);     len = strlen (str);     for (i = 0 ; i <= len; i++)     {         if ( str [i] == '0' && q == 0 )             q = 2 ;         else if ( str [i] == '1' && q == 0 )             q = 1 ;         else if ( str [i] == '0' && q == 1 )             q = 3 ;         else if ( str [i] == '1' && q == 1 )             q = 0 ;         else if ( str [i] == '0' && q == 2 )         ...

Insertion Sort

Image
Insertion Sort An insertion sort is one that sorts a set of values by inserting values into an existing sorted file. Suppose that Iist[] is a list of n elements in memory. The insertion sort technique scans the list Iist[] from Iist[1] to list[n-1], inserting each element list[ k] into its proper position in the previously sorted sublist list[o], list[1], ..., list[n-1]. Illustration: Let list[] be an array of 7 elements: 25, 15, 30, 9, 99, 20, 26. Initial scenario, Step 1: list[1] Step 2:   list[2]>list[1] , so position of elements remain same. Step 3:   list[3] is less than list[2.],list [1] and list[o], thus list[3] is inserted at list[o] position and others are shifted by one position. Step 4:  list[4]>list[3] , so position of elements remain same. Step 5:   list[5] is less than list[4], list[3], and list[2], so list[5] is inserted at the position of list[2] and others are shifted by one position....

Popular posts from this blog

Eliminating Epsilon transition (ε-Transitions) | Conversion of Epsilon-NFA to DFA | Conversion of Epsilon-NFA to NFA | Theory Of Computation (TOC)

C program to Find Cartesian Product of Two Sets | C programming

Top 10 Programming Language to learn in 2023