Search This Blog

MergeSort program to merge two linked lists into a third list

 #include<stdio.h>  
 #include<conio.h>  
 #include<stdlib.h>  
 int flag;  
 struct Node  
 {  
      int data;  
      struct Node* next;  
 };  
 typedef struct Node List;  
 List* start1;  
 List* start2;  
 List* start3;  
 List List1,List2,List3;  
 

Program to find whether a given number is Armstrong in C++ using Class

1:  #include<iostream.h>  
2:  #include<conio.h>  
3:  class Armstrong{  
4:     int num;  
5:     public:  
6:     void input()  
7:     {  
8:        cout<<"Enter the Number:"<<endl;  
9:        cin>>num;  
10:     }  
11:     void findArmstrong();  
12:  };  
13:

Program to find HCF of two Numbers in C++ Using Class

1:  #include<iostream.h>  
2:  #include<conio.h>  
3:  class HCF  
4:  {  
5:    int a,b;  
6:    public:  
7:    void gcd();  
8:    void input(){  
9:    cout<<"Enter two numbers  :"<<endl;  
10:    cin>>a>>b;  
11:    }  
12:  };  
13:

program in java to input three student details and print them in alphabetcal order

//source code:
import java.util.*;
class student
{
String name=new String();
int rollnumber;
float marks;
Scanner s=new Scanner(System.in);
void input()
{
System.out.println("Enter Name");
name=s.nextLine();
System.out.println("Enter Rollnumber");
rollnumber=s.nextInt();
System.out.println("Enter Marks");
marks=s.nextFloat();
System.out.println("*********************************");
}
void show()
{
System.out.println("Name :"+name);
System.out.println("Rollnumber :"+rollnumber);
System.out.println("Marks :"+marks);
System.out.println("*********************************");
}
}
class Order extends student
{
void sort(student... st)
{
for(int i=0;i{

producer consumer problem in java

class Q
{
int n=0;
boolean value=false;

synchronized void get()
{
  while(!value)
{
try{
 wait();
Thread.sleep(1000);
   }
catch(InterruptedException e) { }
}

Program to check whether a given number is a pythons number

A number is said to be pythons number if  digits in the number are powers of the first digit,
for example, a number 24816 is a pythons number because
4=2^2
8=2^3
16=2^4
Other examples are 392781,41664,etc
//source code:

 #‎inc‬ lude. <stdio.h>  
 ‪#‎in‬ clude<math.h>  
 void main(){  
 int c1=0, c2=0, c3=0,p=2;  
 int z,d,x,y,f;  
 unsigned long int n,temp,q;  
 printf("\n Enter a number:");  
 scanf("%d",&n);  
 temp=n;  

C Program to Reverse String Without Using Library Function

??Source code:
 #include <stdio.h>  
 #include<string.h>  
 int main()  
 {  
   char str[20];  
   char r1str[20];  
   char r2str[20];  
   int len;