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...

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 ...

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(...

To Display The Sum Of 1!+2!+3!+.......+n! using C

#include<stdio.h> #include<conio.h> double fact(int n); void main() { int n,i; double sum=0.0; clrscr(); printf("Up To Which Term ?"); scanf("%d",&n); for(i=1;i<=n;++i) sum+=fact(i); printf("Sum Of The Factorials Of The Numbers Up To %d Is %g",n,sum); getch(); } double fact(int n)...

Factorial of a number using c

#include<stdio.h> void main() { int i,n,fact=1; clrscr(); printf("Enter the number : "); scanf("%d",&n); for(i=1;i<=n;i++)  {   fact=fact*i;  }   printf("%d",fact); getch(); ...

Thursday, September 29, 2011

Students Result Calculation program using PL/SQL

Objective An examination has been conducted to a class of 5 students and four scores of each student have been provided in the data along with  register number and name. Write a PL/SQL block to do the following Assign a  letter grade to each student based on the average score; Average Score     Grade 90-100                   a 75-89                      b 60-74                     c...

News Paper Vendor program using PL/SQL

Objective  Every morning a newspaper vendor newspapers in wholesale from a distributor for 60 paise. He sells them in retail for 75 paise. At the end of the day the unsold papers are returned to the distributor for 30 paise rebate per paper. Write a PL/SQL code block to prepare a report for the newspaper vendor in the following format with 5 weeks data. Week     Bought      Sold        Return        Profit       ...

Salary Report program using PL/SQL

Objective A salary statement contains Name, Basic pay , allowance total , deduction (include , IT ),  gross pay, and net pay . Allowance      =    20% of basic pay gross pay       =   Basic pay + Allowance. Deduction      =  10% of basic pay income tax is calculated on the basis of annual income under the following condition. annual salary                                                      Income tax...

Sunday, September 25, 2011

Sales report using SQL

Objective A sales report contains the  record with the following fields: itemid, itemname, salesprice, quantity and total price. Write a PL/SQL procedure to generate sales report. Program SQL>create table sales(itemid varchar(10), itemname varchar(20), salesprice number(6,2), quantity number(4)); Table created SQL>insert into sales values(‘s001’,’pen’,10,10); 1 row created SQL>insert into sales values(‘s002’,’pencil’,4,20); 1 row created SQL>insert into sales values(‘s003’,’scale’,5,10); 1 row created SQL>insert...

Library information System using SQL

Objective Create a library information system Program SQL> create table library(book_id varchar(10) primary key, b_name varchar(20) notnull, author varchar(20) notnull); Table created SQL>insert into library values(‘b001’,’vb’,’abbas’); 1 row created SQL>insert into library values(‘b002’,’cpp’,’kanethkar’); 1 row created SQL>insert into library values(‘b003’,’SAD’,’Alias’); 1 row created SQL>insert into library values(‘b004’,’java’,’kanethkar’); 1 row created SQL> ed lib Decla...

Hotel bill system using SQL

Objective Create a hostel bill calculating system Program SQL> create table hotel(cust_id varchar(6) primary key, cust_name varchar(20), item varchar(20), quantity number(6,2), price number(10,2)); Table created SQL> insert into hotel values(‘H001’,’midhun’,’tea’,3,5); 1 row created SQL> insert into hotel values(‘H002’,’praveen’,’broast’,2,100); 1 row created SQL> insert into hotel values(‘H003’,’dileep’,’rice’,3,20); 1 row created SQL> insert into hotel values(‘H004’,’shiju’,’coffee’,4,10); 1 row created SQL>...

Hostel Accounting system

Objective Create a hostel accounting system Program SQL>create table hostel(stud_id varchar(10) primary key, stud_name varchar(20), rent number(6,2), mess number(6,2),ectr number(6,2), days number(2) check(days<31)and (days>0)); Table created SQL>insert into hostel values(‘100’,’vishnu’,12,5,3,24); 1 row created SQL>insert into hostel values(‘101’,’rabeeh’,12,5,3,20); 1 row created SQL>insert into hostel values(‘102’,’tinu’,12,5,3,28); 1 row created SQL>insert into hostel values(‘103’,’sarath’,12,5,3,14); 1 row...

Saturday, September 24, 2011

Hospital Management System using PL/SQL

Hospital Information System having the following Information Patient Number, Patient Name, Age, Doctor, Patient, type(in/out), Consultation charge, Blood test charge, Xray charge, other test Write a PL/SQL procedure to retrieve the following      1.  Patient undergo blood test      2.  The patient taken x-ray       3.  The patient who belong to patient’s category. Program SQL> create table patient(p_num number(10) primary key, p_name varchar(20),age number(3),dr varchar(20),p_type...

Electricity billing system using PL/SQL

Objective Create an electricity billing system, rent rs 20/- Slab 1 : 1-40 units-0 Slab2: 40-80 units -40 Slab3: >80 -1.40+excess of 80 Program SQL> create table electricity(cons_id varchar(4) primary key, c_name varchar(20), rent number(2) check (rent=20), unit number(6)); Table created SQL> insert into electricity values (‘E001’,’deepika’,20,35); 1 row created SQL> insert into electricity values (‘E002’,’varna’,20,61); 1 row created SQL> insert into electricity values (‘E003’,’arun’,20,80); 1 row created...

Program to accept an amount in rupees and display the number of currency notes

#include <stdio.h> #include<conio.h>  void main()         {             int amt,t,n1,n2,n3,n4,n5,n6,n7,n8,n9,total;             printf("\n Enter the amount");             scanf("%d",&amt);             t=amt;             n1=amt/1000;            amt=amt%1000;            n2=amt/500;            amt=amt%500;           ...

Sunday, August 7, 2011

Matrix addition

#include<stdio.h> void main() { int a[10][10],b[10][10],c[10][10],i,j,row,col; clrscr(); printf("How many rows : "); scanf("%d",&row); printf("How many columns : "); scanf("%d",&col); printf("Enter your 1st matrix :\n"); for(i=0;i<row;++i)    for(j=0;j<col;j++)       {       printf("Element(%d,%d) :",i+1,j+1);       scanf("%d",&a[i][j]);      ...

Armstrong numbers upto a given number

#include<stdio.h> #include<math.h> void main() { int num,sum,lim,dig,temp; clrscr(); printf("Enter the limit :"); scanf("%d",&lim); printf("\nArmstrong num upto %d are :\n",lim); for(num=1;num<=lim;++num)    {    for(temp=num,sum=0;temp>0;temp/=1...

Largest and smallest among n numbers

#include<stdio.h> void main() { int n,i=1,num,big,small; clrscr(); printf("Among how many numbers : "); scanf("%d",&n); if(n<0)   printf("invalid input"); else   {   printf("Enter number %d :",i);   scanf("%d",&num);   big=small=num;   for(;i<n;++i)      {      printf("Enter number %d :",i+1);      scanf("%d",&num);      if(big<num)        big=num;      if(small>num)        small=num;  ...

Matrix subtraction

#include<stdio.h> void main() { int a[10][10],b[10][10],c[10][10],d[10][10],i,j,row,col; clrscr(); printf("How many rows : "); scanf("%d",&row); printf("How many columns : "); scanf("%d",&col); printf("Enter your 1st matrix :\n"); for(i=0;i<row;++i)    for(j=0;j<col;j++)       {       printf("Element(%d,%d) :",i+1,j+1);       scanf("%d",&a[i][j]);       ...

To generate pattern 333 22 1

#include<stdio.h> void main() { int i,j,n; clrscr(); printf("how many lines you need to print :"); scanf("%d",&n); for(i=n;i>0;i--)    {    for(j=0;j<i;j++)       {       printf("%d",i);       }     printf("\n");    } getch()...

To display the 1st n prime numbers

#include<stdio.h> #include<math.h> void main() { int i,num,lim,flag,count=0; clrscr(); printf("Enter the no.of prime numbers:"); scanf("%d",&lim); printf("1st %d prime numbers are :\n",lim); for(num=2;count<lim;++num)    {    flag=1;    for(i=2;i<=sqrt(num);++i...

To generate pattern 1 12 123

#include<stdio.h> void main() { int i,j,n; clrscr(); printf("how many lines you need to print :"); scanf("%d",&n); for(i=0;i<n;i++)    {    for(j=0;j<=i;j++)       {       printf("%d",j+1);       }     printf("\n");    } getch()...

To generate pattern 321 21 1

#include<stdio.h>...

To generate pattern * ** ***

#include<stdio.h>...

To generate pattern*** ** *

#include<stdio.h>...

To generate pattern 1 12 123

#include<stdio.h>...

Number in reverse

#include<stdio.h>...

Sum of individual digits of a number

#include<stdio.h>...

Convert temperature in degree celcius to farenheit

#include<stdio.h>...

Thursday, July 28, 2011

Sum of elements of a matrix

#include<stdio.h> void main(...

Display whole numbers upto a given number

#include<stdio.h> void main() { int i,num=0,n; clrscr(); printf("Enter the limit : upto "); scanf("%d",&n); for(i=0;i<n;i++)  {  num+=1;  printf("%d\t",num);  } getch(); }...

Display whole numbers between two given numbers

#include<stdio.h> void main() { int i,j,num,k,initial; clrscr(); printf("Enter the limit :  "); scanf("%d%d",&j,&k); if(j>k) { num=j-k; initial=k; } else { num=k-j; initial=...

Whole numbers from 100 to 2

#include<stdio.h> void main...

Volume of a box

#include<stdio.h> void main...

Find the Area, Perimeter of a rectangle

#include<stdio.h> void main...

Prime Number

#include<stdio.h> void main...

Palindrome Number

#include<stdio.h> void main...

Display odd numbers upto a given number and display their sum and average

#include<stdio.h> void main...

Check whether the number is multiple of 5

#include<stdio.h> void main...