Posts

WinForms VS WPF in Visual Studio

WPF (Windows Presentation Foundation) and WinForms (Windows Forms) are both frameworks provided by Microsoft for building Windows desktop applications, but they have some key differences: UI Design Approach : WinForms : WinForms uses a more traditional approach to UI design, where controls are positioned using absolute coordinates. It follows a procedural programming model. WPF : WPF uses a more modern approach called "declarative programming", where UI elements are defined using XAML (eXtensible Application Markup Language) and are more flexible in terms of layout. WPF also supports a more powerful data binding system, allowing for easier separation of UI and business logic. Graphics and Multimedia : WinForms : WinForms provides basic support for graphics and multimedia, but it's limited compared to WPF. WPF : WPF has built-in support for hardware-accelerated graphics, 2D and 3D rendering, animations, and multimedia. It provides richer visual capabilities out of the box....

Stack Memory

Image
  Stack Memory Stack is a linear data structure that follows the LIFO (Last-In-First-Out) principle. The stack is managed by the CPU, there is no ability to modify it. Variables are allocated and freed automatically. The stack it not limitless – most have an upper bound. The stack grows and shrinks as variables are created and destroyed Stack variables only exist whilst the function that created them exists       Stack of Books                                                                  Stack of Coins       

Important Links for Coding Interview Preparation

10 important links to practice and study for coding interviews : 1.  patterns to ace any coding interview:  https://lnkd.in/gBu9uZtz 2. Backtracking solution for 10 popular problems:  https://lnkd.in/gjpC9MCC 3. Dynamic Programming patterns for beginners:  https://lnkd.in/gevrxmmy 4. All Graph algorithms in one place:  https://lnkd.in/g2xdz7TY 5. When to use two pointers?:  https://lnkd.in/gqzEDmf6 6. Sliding Window algorithm made easy:  https://lnkd.in/gnDS8sJn 7. Ultimate Binary Search guide:  https://lnkd.in/gg_BB6ik 8. How to solve Linked List problems?:  https://lnkd.in/gp7FgTGx 9. Comprehensive Data Structure and Algorithm study guide:  https://lnkd.in/gcUnWavF 10. How to effectively use Leetcode:  https://lnkd.in/gEuRT4ik

Data Types in C

Data Types in C Primitive Data Types in C: 1. int 2. float 3. char 4. double 5. void Derived Data Types in C: 1. array 2. pointer 3. function User-Defined Data Types in C: 1. structure 2. union 3. enum #include < stdio.h > #include < stdbool.h > // extern variable declaration extern int x; int main () { int age = 30 ; char name [] = " Embedded " ; float average = 66.78 ; char gender = ' M ' ; bool result = true ; printf ( "extern integer Data : %d \n " ,x); printf ( "Integer Data : %d \n " , age ); printf ( "String Data : %s \n " , name ); printf ( "Float Data : %f \n " , average ); printf ( "Character Data : %c \n " , gender ); printf ( "Boolean Data in integer form : %d \n " , result ); printf ( " size of int is = %u \n " , sizeof ( int )); printf ( " size of char is= %u \n " , sizeof ( char )); printf ( ...

Reverse a string in c

 Reverse a string in c : #include < stdio.h > // standard input/output header file #include < string.h > // header file for string int stringLen ( char * str ) { int len = 0 ; for ( int i = 0 ; str [ i ]!= ' \0 ' ; i ++) { len ++; } return len ; } int main () { char str [ 100 ] = " ABC " ; char rev [ 100 ]; int strLength = stringLen ( str ); int j = 0 ; for ( int i = strLength - 1 ; i >= 0 ; i --) { rev [ j ++] = str [ i ]; } rev [ j ] = ' \0 ' ; printf ( " Reverse String is = %s " , rev ); printf ( " \n " ); return 0 ; } Related Posts :  basic-input/output-c-program Check a Prime Number Array in C Swap 2 Numbers Loops in C Data Types in C

Compare 2 Strings in C

Compare two strings in C : #include < stdio.h > #include < string.h > #include < stdbool.h > int main () { char str1 [] = " ABC " ; char str2 [] = " ABC " ; bool res ; int i = 0 ; while ( str1 [ i ] != ' \0 ' && str2 [ i ] != ' \0 ' ) { if ( str1 [ i ] == str2 [ i ]) res = false ; else res = true ; i ++; } printf ( " %d \n " , res ); return 0 ; } Related Posts :  basic-input/output-c-program Check a Prime Number Array in C Swap 2 Numbers Loops in C Reverse String in C

Swap 2 Numbers in C

1. Swap 2 Numbers in C without using extra space or variable  #include < stdio.h > int main () { int a , b ; printf ( " Enter value of a and b " ); scanf ( " %d %d " , & a , & b ); printf ( " a and b before swap is = %d and %d \n " , a , b ); a = a + b ; b = a - b ; a = a - b ; printf ( " a and b after swap is = %d and %d \n " , a , b ); return 0 ; } 2. Swap 2 Numbers in C using extra variable #include < stdio.h > int main () { int a , b ; printf ( " Enter value of a and b " ); scanf ( " %d %d " , & a , & b ); printf ( " a and b before swap is = %d and %d \n " , a , b ); int c ; // temporary variable c = a ; a = b ; b = c ; printf ( " a and b after swap is = %d and %d \n " , a , b ); return 0 ; } Related Posts :  basic-input/output-c-program Array in C Check a Prime Number Loop...