Posts

Showing posts from August, 2020

Find missing number from array range C, C++

Missing number between array's lowest value and highest value elements in C.             #include <stdio.h> int main ( ) { int arr [ 5 ] = { 2 , 5 , 20 , 18 , 15 } ; int min = arr [ 0 ] , max = arr [ 0 ] , i , j , flag = 0 ; for ( i = 0 ; i < 5 ; i ++ ) { if ( arr [ i ] > max ) { max = arr [ i ] ; //find max value } if ( arr [ i ] < min ) { min = arr [ i ] ; //find min value } } for ( i = min ; i < max ; i ++ ) { for ( j = 0 ; j < 5 ; j ++ ) { if ( i == arr [ j ] ) { flag = 1 ; break ; } else { flag = 0 ; } } if ( flag == 0 ) { printf ( "%d " , i ) ; } } return 0 ; }       ...

String Caesar Cipher Program in C and C++

Image
 String Caesar Cipher Program in C              It is one of the simplest encryption technique in which each character in plain text is replaced by a character some fixed number of positions down to it. #include <stdio.h> void main() {     char s[50];     int i, j=0, n;         printf("Enter a String: ");     gets(s);     for(i=0; s[i]!=NULL; i++)     {       s[i] = s[i] + 1;     if (s[i] > 'z')          s[i] = s[i] - 26;     }     printf("%s",s); }          Output:-          Here I also change the case of Vowels in Upper Case.(Optional)   #include <stdio.h> void main() {     char s[50];     int i, j = 0, n;   ...

Select, Insert, Delete, and Update using Stored Procedure in ASP.NET

Image
Select, Insert, Delete, and Update using Stored Procedure in ASP.NET Introduction   Here, we will see how to create select, insert, update, delete statements using stored procedures in SQL Server And ASP .NET .First of all we create a table. CREATE TABLE demo(     id      int      IDENTITY (1,1)      NOT NULL      PRIMARY KEY,     name      nvarchar (50)      NULL,     city      nvarchar( 50)      NULL )                                                             OR Here I inserted few records in the demo table . ...