NevLabs

Under Construction

NevLabs

Under Construction

NevLabs

Under Construction

NevLabs

Under Construction

NevLabs

Under Construction

Thursday, October 20, 2011

Single inheritance program using C++


#include<iostream>
using namespace std;
class base
{
public:
int m;
void get_m()
{
cout<<"\n\n\t\tEnter the value of m :";
cin>>m;
}
void disp()
{
cout<<"\n\n\t\tm :"<<m;
}
};
class derived:public base
{
public:
int n,sum;
void get()
{
cout<<"\n\n\t\tEnter the value of n:";
cin>>n;
}

Tuesday, October 11, 2011

Program using C to calculate Electricity Bill with if-else condition


Conditions      
                <=100 Rs.4/units
                 > 100 and <=300 Rs.4.50/units
                 >300 and <=500 Rs.4.75/units
                 >500 Rs.5/units

Program
#include<stdio.h>
#include<conio.h>
void main ()
{
  int unit, tot;
  clrscr ();
  printf("Enter Total Units:");
  scanf ("%d", &unit);
   if (unit<=100)
     {
      tot=unit*4;
     }
   else if (unit>100 && unit<=300)
     {
      tot=unit*4.5;
     }

Multiplication Table Using C


#include <stdio.h>
#include <conio.h>
 void main()
{
   Int i,n,num;
  clrscr();
  printf(“Enter the number to print multiplication table :”);
  scanf(“%d”,&num);
  printf(“how many terms :”);
  scanf(“%d”,&n);
  clrscr();
  printf(“======MULTIPLICATION TABLE=======\n             ”);
  for(i=1;i<=n;i++);
  printf(“%d*%d=%3d”,i,num,i*num);
  getch();
}

C program to display perfect,abudent,and deficiant numbers


#include<conio.h>
#include<stdio.h>
#include<iostream.h>
#include<math.h>
int test(int n);
void main()
{
int i,lower,upper,temp;
clrscr();
printf("Enter the range\n");
printf("\tLower Bound?");
scanf("%d",&lower);
printf("\tUpper Bound?");
scanf("%d",&upper);
if(lower>upper)
{  
temp=lower;
lower=upper;
upper=temp;
}

Wednesday, October 5, 2011

Love Calculator Using C++


#include<iostream.h>
#include<conio.h>
#include<dos.h>
#include<stdio.h>
#include<string.h>
int q=0;
char name1[100],name2[100],n[100];
void load(int x)
{
textcolor(BLUE);
for(int i=0;i<x+1;i++)
{
clrscr();
cout<<"\n\n                        LOVE CALCULATOR\n";
cout<<"      ===============\n\n";
cout<<"      Your Name : "<<name1;
cout<<"\n\n     Lover Name : "<<name2;
cout<<"\n\n               Enter a number : "<<n;
cout<<"\n\n\n";
textcolor(RED);
cputs("                        LOVE PERCENTAGE : ");
textcolor(RED);
cout<<i<<"%";
textcolor(BLUE);
delay(20);
}

Friday, September 30, 2011

Program To search a number in a set of numbers using C


#include<stdio.h>
#include<conio.h>
void main()
{
int  i,n,count=0;
float num[50],search;
clrscr();
printf("how many numbers ?");
scanf("%d",&n);
if(n<=0)
printf("invalid data");
else
{
for(i=0;i<n;i++)
{
printf("Enter the number-%d:",i+1);
scanf("%f",&num[i]);
}
printf("\n\n\nNumber to searched ? ");
scanf("%f",&search);
clrscr();