NevLabs

Under Construction

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