This is default featured slide 1 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
This is default featured slide 2 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
This is default featured slide 3 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
This is default featured slide 4 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
This is default featured slide 5 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
Thursday, February 22, 2018
GENERAL QUESTIONS-GK #1
Sunday, January 21, 2018
NEA AND NEC REPORT
Nepal Engineering Council Rules, 2057 has also been prepared and approved by His Majesty's Government as per the provision of Clause 37 of the Act. It defines the registration of engineers into three categories as well as the formats for application:
a) General Registered Engineer
b) Professional Engineer
c) non - Nepali Registered Engineer
NEC Rules 2057 also lays down the professional code of conduct for engineers registered with the Council. The first Executive Council was formed on Magh 2056 under the chairmanship of Er. Ram Babu Sharma and completed its tenture on Magh 2060.
NEC
|
NEA
|
Statutory body, established under NEC Act, in
1999
|
An NGO, established in 1962
|
Must register before practicing engineering
profession
|
Registration/membership is voluntary
|
Executive body by election and nomination
|
Executive body by election
|
Evaluates and approves establishment of academic
institutes offering engineering programs
|
No such provision
|
Offers different categories of engineering
profession: general, professional, foreign
|
No such provision
|
Monitors academic institutes offering
engineering programs (every year for temporary approval and every other year
for permanent approval), and cancels approval if found not up to standard
|
No such provision
|
The directives and code of conduct issued are
mandatory
|
The directives and code of conduct issued are
voluntary
|
Phone no. :4420655, 4420656
LAGRANGE FORMULA/METHOD IN C PROGRAMMING
#include<stdio.h>
void main()
{
int n,i,j;
float x[15],y[15],prod,sum=0,a;
printf("Enter no. of data and a : ");
scanf("%d%f",&n,&a);
for(i=1;i<=n;i++)
{
printf("Enter x%d,y%d : ",i,i);
scanf("%f%f",&x[i],&y[i]);
}
for(i=1;i<=n;i++)
{
prod=1;
for(j=1;j<=n;j++)
{
if(i!=j)
{
prod=prod*(a-x[j])/(x[i]-x[j]);
}
}
sum=sum+prod*y[i];
}
printf("y(%f) = %f ",a,sum);
}
GAUSS JODON INVERSE IN C PROGRAMMING
#include<stdio.h>
#include<stdlib.h>
void main()
{
int i,j,k,n;
float a[15][15],d,r;
printf("Enter order of matrix :");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
printf("Enter a[%d][%d] : ",i,j);
scanf("%f",&a[i][j]);
}
}
for(i=1;i<=n;i++)
{
for(j=n+1;j<=2*n;j++)
{
if(j==n+i)
{
a[i][j]=1;
}
else
{
a[i][j]=0;
}
}
}
for(j=1;j<=n;j++)
{
if(a[j][j]==0)
{
printf("Error");
exit(0);
}
for(i=1;i<=n;i++)
{
if(i!=j)
{
r=(a[i][j])/(a[j][j]);
for(k=1;k<=2*n;k++)
{
a[i][k]=a[i][k]-r*a[j][k];
}
}
}
}
for(i=1;i<=n;i++)
{
d=a[i][i];
for(j=1;j<=2*n;j++)
{
a[i][j]=a[i][j]/d;
}
}
for(i=1;i<=n;i++)
{
for(j=1;j<=2*n;j++)
{
printf(" %f",a[i][j]);
}
printf("\n");
}
}
GAUSS JORDON MEHTOD IN C PROGRAMMING
#include<stdio.h>
void main()
{
int i,j,k,n;
float a[15][15],x[10],r;
printf("Enter order of matrix :");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=n+1;j++)
{
printf("Enter a[%d][%d] : ",i,j);
scanf("%f",&a[i][j]);
}
}
for(j=1;j<=n;j++)
{
for(i=1;i<=n;i++)
{
if(i!=j)
{
r=(a[i][j])/(a[j][j]);
for(k=1;k<=n+1;k++)
{
a[i][k]=a[i][k]-r*a[j][k];
}
}
}
}
for(i=1;i<=n;i++)
{
x[i]=(a[i][n+1])/(a[i][i]);
printf("x%d = %f\t",i,x[i]);
}
}
GAUSS ELIMINATION METHOD IN C PROGRAMMING
#include<stdio.h>
void main()
{
int i,j,k,n;
float r,a[20][20],x[20],sum;
printf("Enter matrix size : ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=n+1;j++)
{
printf("Enter a%d%d : ",i,j);
scanf("%f",&a[i][j]);
}
}
for(j=1;j<=n-1;j++)
{
for(i=j+1;i<=n;i++)
{
r=a[i][j]/a[j][j];
for(k=1;k<=n+1;k++)
{
a[i][k]=a[i][k]-r*a[j][k];
}
}
}
x[n]=a[n][n+1]/a[n][n];
for(i=n-1;i>=1;i--)
{
sum=0;
for(j=i+1;j<=n;j++)
{
sum=sum+a[i][j]*x[j];
}
x[i]=(a[i][n+1]-sum)/a[i][i];
}
for(i=1;i<=n;i++)
{
printf("x%d = %.4f\t",i,x[i]);
}
}
SECOND DEGREE CURVE FITTING IN C PROGRAMMING
#include<stdio.h>
void main()
{
int n,i,j,k;
float a[10][10],x[10],y[10],r;
float sumx=0,sumx2=0,sumx3=0,sumx4=0,sumxy=0,sumx2y=0,sumy=0;
printf("Enter no. of data : ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("Enter x%d,y%d : ",i,i);
scanf("%f%f",&x[i],&y[i]);
}
for(i=1;i<=n;i++)
{
sumx+=x[i];
sumx2+=x[i]*x[i];
sumx3+=x[i]*x[i]*x[i];
sumx4+=x[i]*x[i]*x[i]*x[i];
sumxy+=x[i]*y[i];
sumx2y+=x[i]*x[i]*y[i];
sumy+=y[i];
}
a[1][1]=a[2][2]=a[3][3]=sumx2;
a[1][2]=a[2][3]=sumx;
a[2][4]=sumxy;
a[3][4]=sumx2y;
a[3][1]=sumx4;
a[2][1]=a[3][2]=sumx3;
a[1][4]=sumy;
a[1][3]=n;
for(j=1;j<=3;j++)
{
for(i=1;i<=3;i++)
{
if(i!=j)
{
r=a[i][j]/a[j][j];
for(k=1;k<=4;k++)
{
a[i][k]=a[i][k]-r*a[j][k];
}
}
}
}
for(i=1;i<=3;i++)
{
x[i]=a[i][4]/a[i][i];
}
printf("a = %f\t b = %f\tc = %f",x[1],x[2],x[3]);
}
SECANT MEHTOD IN C PROGRAMMING
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
float f(float x)
{
return(pow(x,3)-2*x-5);
}
void main()
{
float x,a,b;
printf("Enter two initial guesses a & b : ");
scanf("%f%f",&a,&b);
do
{
if(f(a)==f(b))
{
printf("Denominator is zero");
exit(0);
}
x=(a*f(b)-b*f(a))/(f(b)-f(a));
a=b;
b=x;
}while(fabs(f(x))>0.00005);
printf("Solution = %f, f(x)= %f",x,f(x));
}
RUNGE-KUTTA 4 (RK-4) METHOD IN C PROGRAMMING
#include<stdio.h>
#include<math.h>
float f(float x, float y)
{
return (x+y);
}
void main()
{
float x0,y0,h,x,m,m1,m2,m3,m4;
printf("Enter x0, y0, h , x : ");
scanf("%f%f%f%f",&x0,&y0,&h,&x);
while(x0<x)
{
m1=f(x0,y0);
m2=f(x0+h/2,y0+m1*h/2);
m3=f(x0+h/2,y0+m3*h/2);
m4=f(x0+h,y0+m3*h);
m=(m1+2*m2+2*m3+m4)/6;
y0+=h*m;
x0+=h;
printf("x = %2.4f \t\t y = %2.4f\n",x0,y0);
}
}
NEWTON-RAPHSON METHOD IN C PROGRAMMING
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
float f(float x)
{
return(pow(x,4)-x-10);
}
float df(float x)
{
return(4*x*x-1);
}
void main()
{
float x,x1;
int c=0,i;
printf("Enter initial guess and iteration : ");
scanf("%f%d",&x,&i);
do
{
if(df(x)==0)
{
printf("derivative zero");
exit(0);
}
x1=x-(f(x)/df(x));
x=x1;
c++;
if(c==i)
{
printf("Root not convergence");
exit(0);
}
}while(fabs(f(x))>0.00005);
printf("Root = %f,f(x) = %f",x1,f(x1));
}
LINEAR CURVE FITTING IN C PROGRAMMING
void main()
{
float a,b,sumx,sumy,sumxy,sumx2,x[50],y[50];
int i,n;
sumx=0;
sumy=0;
sumxy=0;
sumx2=0;
printf("Enter no. of data : ");
scanf("%d",&n);
for (i=0;i<n;i++)
{
printf("Enter x(%d) and y(%d) : ",i+1,i+1);
scanf("%f%f",&x[i],&y[i]);
}
for (i=0;i<n;i++)
{
sumx+=x[i];
sumy+=y[i];
sumxy+=x[i]*y[i];
sumx2=x[i]*x[i];
}
a=(sumy*sumx2-sumxy*sumx)/(n*sumx2-sumx*sumy);
b=(sumy*sumx-n*sumxy)/(n*sumx2-sumx*sumy);
printf("a =%f\nb=%f",a,b);
}
EXPONENTIAL CURVE FITTING IN C PROGRAMMING
#include<math.h>
void main()
{
float a,b,sumx,sumy,sumxy,sumx2,x[50],y[50];
int i,n;
sumx=0;
sumy=0;
sumxy=0;
sumx2=0;
printf("Enter no. of data : ");
scanf("%d",&n);
for (i=0;i<n;i++)
{
printf("Enter x(%d) and y(%d) : ",i+1,i+1);
scanf("%f%f",&x[i],&y[i]);
y[i]=log(y[i]);
}
for (i=0;i<n;i++)
{
sumx+=x[i];
sumy+=y[i];
sumxy+=x[i]*y[i];
sumx2=x[i]*x[i];
}
a=(sumy*sumx2-sumxy*sumx)/(n*sumx2-sumx*sumy);
b=(-sumy*sumx+ n*sumxy)/(n*sumx2-sumx*sumy);
a=exp(a);
printf("a =%f\nb=%f",a,b);
}
EULER'S METHOD IN C PROGRAMMING
#include<stdio.h>
#include<math.h>
float f(float x, float y)
{
return (x+y);
}
void main()
{
float x0,y0,h,x,m,m1,m2,m3,m4;
printf("Enter x0, y0, h , x : ");
scanf("%f%f%f%f",&x0,&y0,&h,&x);
while(x0<x)
{
y0+=h*f(x0,y0);
x0+=h;
printf("x = %2.4f \t\t y = %2.4f\n",x0,y0);
}
}
BISECTION METHOD IN C PROGRAMMING
#include<stdlib.h>
#include<math.h>
float function(float x)
{
return (exp(x)+x);
}
void main()
{
float a,b,c;
printf("Enter a and b : ");
scanf("%f%f",&a,&b);
if(function(a)*function(b)>0)
{
printf("Enter appropriate interval\n");
exit(0);
}
else
{
do
{
c=(a+b)/2;
if(function(a)*function(c)<0)
{
b=c;
}
else
{
a=c;
}
}while(fabs(function(c))>0.0005);
printf("solution = %f \t\tf(x)= %f",c,function(c));
}
}