#include<stdio.h>
#include<conio.h>
void main()
{
float x[100],y[100],value2,value,fx,h;
int i,size;
clrscr();
printf("How many value you want to enter: ");
scanf("%d",&size);
for(i=0; i<size; i++)
{
printf("Enter elements of x[%d]:\n",i);
scanf("%f",&x[i]);
printf("Enter elements of y[%d]:\n",i);
scanf("%f",&y[i]);
}
h = x[2]-x[1];
printf("\nh = %f",h);
for(i=1; i<size-1; i++)
{
if(i%3==0)
value2 += 2*y[i];
else
value += 3*y[i];
}
printf("value2 = %f \n value = %f",value2, value);
fx = ( h*3)/8 * ( y[0] + y[size-1] + value + value2 );
printf("\nf(x)= %f",fx);
getch();
}
there is some good c ,java, sql and vb6 programs,Windows tricks, sms shorthand etc
Friday, March 30, 2012
WAP of Simpson3/8 in C
/* WAP of Simpson3/8 in C */
Thursday, March 29, 2012
WAP of Switch case in Java
/*WAP to capture the two integer values from user and perform following actions according to user Requierement
1. Addition
2. Substraction
3. Multiplication
4. Division
5. Exit
*/
1. Addition
2. Substraction
3. Multiplication
4. Division
5. Exit
*/
import java.lang.*;
import java.io.*;
class oprations
{
public void InputMsg()
{System.out.println("Enter Two Integer numbers. ");}
public void continueMsg()
{System.out.println("Do you want to Continue. \n1. Yes \n0. No");}
public static void main (String args[]) throws IOException
{
int a , b, choice = -1 ;
do
{
System.out.println("Choose a Opration");
System.out.println("1. Addition \n2. Substraction \n3. Multiplication \n4. Division \n5. Exit \nYour Choice: ");
BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));
oprations e = new oprations();
choice = Integer.parseInt(br.readLine());
int repeate = -1;
do
{
switch(choice)
{
case 1: e.InputMsg();
a = Integer.parseInt(br.readLine());
b = Integer.parseInt(br.readLine());
System.out.println("Addition = "+(a+b));
e.continueMsg();
repeate = Integer.parseInt(br.readLine());
break;
case 2: e.InputMsg();
a = Integer.parseInt(br.readLine());
b = Integer.parseInt(br.readLine());
System.out.println("Substraction = "+(a-b));
e.continueMsg();
repeate = Integer.parseInt(br.readLine());
break;
case 3: e.InputMsg();
a = Integer.parseInt(br.readLine());
b = Integer.parseInt(br.readLine());
System.out.println("Multiplication = "+(a*b));
e.continueMsg();
repeate = Integer.parseInt(br.readLine());
break;
case 4: e.InputMsg();
a = Integer.parseInt(br.readLine());
b = Integer.parseInt(br.readLine());
System.out.println("Division = "+(a/b));
e.continueMsg();
repeate = Integer.parseInt(br.readLine());
break;
case 5: System.out.println("BYE!");
break;
default: System.out.println("Invalid Input.");
}
}while(repeate != 0 && choice != 5);
}while(choice != 5);
}
}
WAP of Bubble Short in C++
/*WAP of Bubble Short in C++*/
#include<iostream.h>
#include<conio.h>
class bubbleShort
{
int size, a[100];
public:
void getdata();
void sorting();
};
void bubbleShort :: getdata()
{
int i;
cout << "\nEnter total number of elements: " ;
cin >> size;
cout << "\nEnter elements: ";
for(i=0;i<size;i++)
cin >> a[i];
cout << "\nEntered elements are: ";
for(i=0;i<size;i++)
cout << a[i] << " ";
}
void bubbleShort :: sorting()
{
int i,j,temp;
for(i=1;i<size;i++)
{
for(j=0;j<size-i;j++)
{
if(a[j]>a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
cout << "\nElements After Shorting:";
for(i=0;i<size;i++)
cout << "\n" << a[i];
}
void main()
{
clrscr();
bubbleShort bsrch;
bsrch.getdata();
bsrch.sorting();
getch();
}
WAP of Linear Search in C++
/*WAP of Linear Search in C++*/
#include<iostream.h>
#include<conio.h>
class linearSearch
{
int size, a[100],item;
public:
void setData();
void searchItem();
};
void linearSearch :: setData()
{
int i;
cout << "\nEnter total number of elements: " ;
cin >> size;
cout << "\nEnter elements: ";
for(i=0;i> a[i];
cout << "\nEnter Item which you want to find: ";
cin >> item;
}
void linearSearch :: searchItem()
{
int k=1, loc=0;
while(loc==0 && k<=size)
{
if(item == a[k-1])
{
loc = k;
}
k +=1;
}
if(loc==0)
cout << "\n" << item << " isn't Found.";
else
cout << "\n" << item << " at Location " << loc;
}
void main()
{
clrscr();
linearSearch bsrch;
bsrch.setData();
bsrch.searchItem();
getch();
}
WAP of Matrix Multiplication in Java
/*WAP of Matrix Multiplication in Java*/
import java.lang.*;
import java.io.*;
import java.util.*;
class matrix
{
public static void main (String args[]) throws IOException
{
int a[][] = new int[2][2];
int b[][] = new int[2][2];
int c[][] = new int[2][2];
Scanner sc = new Scanner(System.in);
System.out.println("Enter Elements of Matrix 1");
for(int i=0; i<2; i++)
{
for(int j=0; j<2; j++)
{
a[i][j] = sc.nextInt();
}
}
System.out.println("Enter Elements of Matrix 2");
for(int i=0; i<2; i++)
{
for(int j=0; j<2; j++)
{
b[i][j] = sc.nextInt();
}
}
// calculation
for(int i=0; i<2; i++)
{
for(int j=0; j<2; j++)
{
for(int k=0; k<2; k++)
{
c[i][j] += a[i][k] * b[k][j];
}
}
}
System.out.println("Matrix After multiplication");
for(int i=0; i<2; i++)
{
for(int j=0; j<2; j++)
{
System.out.println( "\t" + c[i][j] );
}
}
}
}
Tuesday, March 20, 2012
WAP of Simpson's 1/3
/* WAP of Simpson's 1/3 */
#include<stdio.h>
#include<conio.h>
void main()
{
float x[100],y[100],odd, even,fx,h;
int size,i;
clrscr();
printf("How many value you want to enter: ");
scanf("%d",&size);
for(i=0; i<size; i++)
{
printf("Enter elements of x[%d]:\n",i);
scanf("%f",&x[i]);
printf("Enter elements of y[%d]:\n",i);
scanf("%f",&y[i]);
}
h = x[2]-x[1];
printf("\nh = %f",h);
for(i=1; i<size-1; i++)
{
if(i%2==0)
{
even += 2*y[i];
}
else //if(i%2 != 0)
{
odd += 4*y[i];
}
}
fx = ( h/3) * ( y[0] + y[size-1] + odd + even );
printf("\nf(x)= %f",fx);
getch();
}
Monday, December 5, 2011
Student record using Array of Structure in c
/*WAP of Student record using Array of Structure in c*/
#include<stdio.h>
#include<conio.h>
struct student
{
int rollno, marks1,marks2,marks3,tot;
char name[25],grade;
float per;
};
void main()
{
struct student s[5]; //Data type of '*s' is struct student
int i;
clrscr();
printf("\t*Students Records*\n");
//take input from user
for (i=0; i<5; i++)
{
printf("\nEnter Student Roll Number: ");
scanf("%d", &s[i].rollno);
printf("\nEnter Student name: ");
scanf("%s", s[i].name);
printf("\nEnter Student 3 subject's marks: ");
scanf("%d%d%d", &s[i].marks1,&s[i].marks2,&s[i].marks3);
//calculation
s[i].tot = s[i].marks1 + s[i].marks2 + s[i].marks3;
s[i].per = s[i].tot/3;
if(s[i].per>=75){
s[i].grade = 'A';
}
else if(s[i].per<75 && s[i].per>=60){
s[i].grade = 'B';
}
else if(s[i].per<60 && s[i].per>=50){
s[i].grade = 'C';
}
else if(s[i].per<50 && s[i].per>=40){
s[i].grade = 'D';
}
else if(s[i].per<40 && s[i].per>=33){
s[i].grade = 'E';
}
else {
s[i].grade = 'F';
}
}
//Display result
for (i=0; i<5; i++)
{
printf("\n==================================\n");
printf("\nStudent's Roll no. - %d", s[i].rollno);
printf("\nStudent's Name - %s", s[i].name);
printf("\nStudent's Total Marks - %d", s[i].tot);
printf("\nStudent's Percentage - %f", s[i].per);
printf("\nStudent's Grade - %c", s[i].grade);
}
getch();
}
Student record using Structure in c
/*WAP of Student record using Structure in c*/
#include<stdio.h>
#include<conio.h>
struct student
{
int rollno, marks1,marks2,marks3,tot;
char name[25],grade;
float per;
};
void main()
{
struct student s; //Data type of '*s' is struct student
clrscr();
//take input from user
printf("Enter Student Roll Number: ");
scanf("%d", &s.rollno);
printf("\nEnter Student name: ");
scanf("%s", s.name);
printf("\nEnter Student 3 subject's marks: ");
scanf("%d%d%d", &s.marks1,&s.marks2,&s.marks3);
//calculation
s.tot = s.marks1 + s.marks2 + s.marks3;
s.per = s.tot/3;
if(s.per>=75){
s.grade = 'A';
}
else if(s.per<75 && s.per>=60){
s.grade = 'B';
}
else if(s.per<60 && s.per>=50){
s.grade = 'C';
}
else if(s.per<50 && s.per>=40){
s.grade = 'D';
}
else if(s.per<40 && s.per>=33){
s.grade = 'E';
}
else {
s.grade = 'F';
}
//Display result
printf("\n==================================\n");
printf("\nStudent's Roll no. - %d", s.rollno);
printf("\nStudent's Name - %s", s.name);
printf("\nStudent's Total Marks - %d", s.tot);
printf("\nStudent's Percentage - %f", s.per);
printf("\nStudent's Grade - %c", s.grade);
getch();
}
Tuesday, November 15, 2011
Monday, February 14, 2011
Save downloads to a different directory
Save downloads to a different directory.
These tips apply primarily to Windows 7
fie Windows 7 Downloads directory sounds convenient, but since few
users ever go browsing there, downloaded files may be forgotten for
days. Most browsers will default to downloading into this directory.
Firefox and Chrome users can change this relatively easily, though,
to something more convenient. In Firefox, click Tools Options. Under
the General tab, change the ‘Save files to’ setting to the directory
of your choice. In Google Chrome, click the Tools icon (it looks like
a wrench), then Options. Click the Minor Tweaks tab and change the
‘Download location’ setting there. IE users unfortunately have to hack
the Registry to make this change (a step that only power users should
consider taking).
Friday, January 28, 2011
Use Windows’ Problem Steps Recorder
Use Windows’ Problem Steps Recorder.
These tips apply primarily to Windows 7
Tech support calls are a pain. If you’re having computer problems,
don’t get stuck on an endless phone call trying to explain the
difficulty. Run Windows’ Problem Steps Recorder to save a step by
step history of what you’re doing so you can share it with a friend
or tech support pro. Type PSR in the Start menu search box to find
and run the recorder. Then go through the steps that lead to your
problem; PSR will record a screenshot of each step, logging everything
you type and click. When you’re finished, click the Stop button and save
the file. E-mail the archive to someone who’s better informed for a
solution. (Note: this resource can also be used to make quick-and-dirty
tutorials.)
Monday, January 24, 2011
LIKE command with % when character at middle
LIKE command with % when character at middle
select stdName,stdAddress from student where stdAddress like '%a%'
Wednesday, January 12, 2011
LIKE command with % when character at starting
LIKE command with % when character at starting
select stdName,stdAddress from student where stdName like 'A%'
Sunday, January 9, 2011
LIKE command when with % character at ending
LIKE command when with % character at ending
select stdName,stdAddress from student where stdName like '%a'
Wednesday, December 29, 2010
LIKE command
LIKE command
select stdName,stdAddress from student where stdName like 'ABC'
Sunday, December 26, 2010
Give yourself more screen real estate in Windows 7’s
Give yourself more screen real estate in Windows 7’s.
These tips apply primarily to Windows 7
You can shrink Windows 7’s oversize taskbar icons by right-clicking the taskbar,choosing Properties, and selecting Use small icons. This option shrinks the size of the taskbar by half, giving you a few extra millimeters of vertical screen space.
Tuesday, December 14, 2010
WAP to use while loop in PL/SQL
WAP to use while loop in PL/SQL
step-1
RUN THIS COMMANDcreate table tb1(id number);
IF SUCCESSFULLY RUN THEN WRITE PL/SQL COMMAND
step-2
declare
vid number:=0;
begin
while(vid<=10)
loop
insert into tb1(id)
values(vid);
vid:=vid+1;
dbms_output.put_line(vid);
end loop;
end;
Tuesday, December 7, 2010
WAP to use for-loop in PL/SQL
WAP to use for-loop in PL/SQL
step-1
create table tb1(id number);
RUN THIS COMMAND, IF SUCCESSFULLY RUN THEN WRITE PL/SQL COMMAND
step-2
declare
vid number:=0;
begin
for vid in 1..10
loop
insert into tb1(id)
values(vid);
dbms_output.put_line(vid);
end loop;
end;
Monday, December 6, 2010
Lowercase all-capitals text in a trice
Lowercase all-capitals text in a trice.
These tips apply primarily to Windows 7
In Microsoft Office apps, convert the text to lowercase by
selecting it and pressing shift + f3.
Press a second time to convert the text to title case.
Saturday, December 4, 2010
WAP to use cursor in pl/sql
WAP to use cursor in pl/sql
step-1 create a table
create table student(stdRollNo number, stdName varchar2(25),
stdClass varchar2(25)); RUN these COMMAND IF SUCCESSFULLY RUN THEN WRITE step-2 insert 2 or more values insert into student values(01,'ABC','XII'); RUN these COMMANDs, IF SUCCESSFULLY RUN THEN WRITE PL/SQL COMMAND step-3 declare vid number; vname varchar2(25); cursor std is select stdRollno,stdName from student where stdClass='XII'; begin open std; loop fetch std into vid,vname; exit when std%notfound; dbms_output.put_line(vid); end loop; close std; end;
Subscribe to:
Posts (Atom)
How to earn online
How to earn online:
Step - 1 :
signup for PayPal, to recieve your online earning
click here:
https://www.paypal.com/in/mrb/pal=CZ7224TZBMCBL
step - 2 : Singup these 4 sites & earn & enjoy! Read site to know how to earn.
1. trekpay
Earn up to $0.02 (2 cents) per click.
http://www.trekpay.com/?ref=34690
2. neobux
Earn up to $0.02 (2 cents) per click.
Click here:
http://www.neobux.com/?r=Moneyearner786
Step - 1 :
signup for PayPal, to recieve your online earning
click here:
https://www.paypal.com/in/mrb/pal=CZ7224TZBMCBL
step - 2 : Singup these 4 sites & earn & enjoy! Read site to know how to earn.
1. trekpay
Earn up to $0.02 (2 cents) per click.
http://www.trekpay.com/?ref=34690
2. neobux
Earn up to $0.02 (2 cents) per click.
Click here:
http://www.neobux.com/?r=Moneyearner786
