Posts

bubble sort in c

  // bubble sort #include <stdio.h> int main () {     int i, j,c,n,array[ 100 ],swap;     printf ( "enter the elements of for which you want to sort:" );     scanf ( "%d" ,&n);     printf ( "enter the %d \n elements" );     for (i= 0 ;i<n;i++)     {         scanf ( "%d" ,&array[i]);     }         for (i= 0 ;i<(n- 1 );i++)         {             for (j= 0 ;j<(n-i- 1 );j++)             {                 if (array[j]<array[j+ 1 ])                 {                     swap=array[j];                     array[j]=array[j+ 1 ];                     array[j+ 1 ]=swap;                                      }         }     }             printf ( "sorted list in ascending order:" );             for (i= 0 ;i<n;i++)             {                 printf ( "%d\n" ,array[i]);                              }             return 0 ;              }

nested structure in c and using that finding the distance between two place

 // using structure add two distance  #include<stdio.h>  struct distance {     int feet;     float inch;           }; struct moredistance {     int meter;     float centi; } distance1, distance2,sum; int main() {   printf("enter the distance1  in feet:\n");  scanf("%d",&distance1.meter);    printf("enter the distance 2 in inch\n");  scanf("%f",&distance2.centi);  sum.meter=distance1.meter+distance2.centi;      printf("sum of distance1 and distance 2 is %d",sum.meter);   }  

New project

 <!doctype html> <html > <head> <title> </title> </head> <body> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body {    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .sample {    width: 50%;    background-color: lightblue;    height: 200px;    font-size: 18px; } @media only screen and (max-width: 700px) {    body {       margin: 0;       padding: 0;    }    .sample {       width: 100%;    } } </style> </style> </head> <body> <h2>The news which always give you updates   </h2> <p></p> <body> <img  height="100" width="100" class="img-header" src="https://images.vexels.com/media/users/3/129616/isolated/preview/fb517f8913bd99cd48ef00facb4a67c0-businessman-avatar-silhouette-by-vexels.png"> </body>  <ul>   <li><a href="#home"   oncli

new style

 fun main() {     val border = "%" printBoarder(border) println(" the queen of jhansi") printBoarder(border) } fun printBoarder(border:String) {     repeat(23)     {         print("=")     }     println() }

Printing Queen of Jhansi

 fun main() { printBoarder() println(" the queen of jhansi") printBoarder() } fun printBoarder() {     repeat(23)     {         print("=")     }     println() }

Android Development Basic

  fun main () {         val age = 5 * 365     val name = "Rover"         println ( "Happy Birthday, ${name}!" )         // Let's print a cake!     println ( "   ,,,,,   " )     println ( "   |||||   " )     println ( " =========" )     println ( "@@@@@@@@@@@" )     println ( "{~@~@~@~@~}" )     println ( "@@@@@@@@@@@" )         // This prints an empty line.     println ( "" )     println ( "You are already ${age} days old, ${name}!" )     println ( "${age} days old is the very best age to celebrate!" ) }

write a program to overload the function ++ and -- for the prifix and suffix in c++

 // write a program to overload the function ++ and -- for the prifix and suffix #include<iostream> using namespace std; class number {     float x;     public:     number(float k)     {         x=k;;     }          void operator ++(int)     {         x++;              }     void operator --()     {         --x;     }     void show()     {         cout<<"\n x="<<x;              } }; int main() {     number N(2.3);     cout<<"/n befor the incrimination";     N.show();     cout<<"\n after incrimination :";     N++;     N.show();     cout<<"\n after discrimination";     --N;     N.show();      }