find array minimum value use function.

Standard

#include
int findSmaller(int a[],int n);
int main()
{
int n,i,a;
int array[50];

printf(“Enter the size of array: “);
scanf(“%d”,&n);
for(i=0;i<n;i++)
{
printf("\nEnter value of array[%d]:",i);
scanf("%d",&array[i]);
}

a=findSmaller(array,n);
printf("\nthe smaller value is: %d\n",a);
return 0;
}

int findSmaller(int a[],int n)
{
int i=0,temp;
temp=a[0];

for(i;i<n;i++)
{

if(a[i]<temp)
{
temp=a[i];

}

}

return temp;
}

array size and value input.

Standard

#include

int main()
{

int s,i,n,a[50];
printf(“Enter number of elements:”);
scanf(“%d”,&n);
for(i=0;i<n;i++)
{
printf("Enter a value: ");
scanf("%d",&a[i]);
}
printf("\nthe original array is :\n");
for(i=0;i<n;i++)
{
printf("a[%d]= %d\n",i,a[i]);
}
printf("\n\n");
//printf("Enter a scale:\n");
// scanf("%d",&s);

for(i=0;i<n;i++)
{
a[i]=a[i]*2;
}
printf("The modified array is: \n");
for(i=0;i<n;i++)
{
printf("a[%d]= %d\n",i,a[i]);
}
printf("\n\n");
return 0;
}

fabachi serise

Standard

#include

int main()
{
int n;
int cur,prev_prev=1,prev=1,i;
int a[50];
a[0]=prev_prev;
a[1]=prev;
printf(“How many numbers: \n”);
scanf(“%d”,&n);

for(i=2;i<n;i++)
{
cur=prev_prev+prev;
prev_prev=prev;
prev=cur;
a[i]=cur;

}

for(i=0;i<n;i++)
{
printf("a[%d]=%d\n",i,a[i]);
}

return 0;
}

database only basic

Standard

create table customer
(
account_id varchar(20),
accountholder_name varchar(50),
amount decimal(9,2),
opening_date varchar(50),
primary key(account_id)
);

insert into customer(account_id,accountholder_name,amount,opening_date)
values(‘11310029′,’rubel’,100000,’1-01-198′);
insert into customer(account_id,accountholder_name,amount,opening_date)
values(‘11310028′,’sweety’,500000,’1-01-1999′);
insert into customer(account_id,accountholder_name,amount,opening_date)
values(‘11310027′,’sabina’,600000,’1-01-1998′);
insert into customer(account_id,accountholder_name,amount,opening_date)
values(‘11310026′,’samad’,700000,’1-01-1997′);
insert into customer(account_id,accountholder_name,amount,opening_date)
values(‘11310025′,’rokeya’,100000,’1-01-1996′);
insert into customer(account_id,accountholder_name,amount,opening_date)
values(‘11310024′,’sweety’,500000,’1-01-1982′);
insert into customer(account_id,accountholder_name,amount,opening_date)
values(‘11310023′,’sabina’,600000,’1-01-1983′);
insert into customer(account_id,accountholder_name,amount,opening_date)
values(‘11310022′,’samad’,700000,’1-01-1984′);
insert into customer(account_id,accountholder_name,amount,opening_date)
values(‘11310021′,’rokeya’,100000,’1-01-1985′);

insert into customer(account_id,accountholder_name,amount,opening_date)
values(‘11310018′,’rokeya’,900000,’1-01-1976′);

update customer set amount=amount+amount*(10/100) where amount>=’100000′;

select account_id,amount from customer;

select accountholder_name,opening_date from customer;
select amount from customer where amount>=’500000′;
select amount from customer where amount<='500000';

delete from customer;

or

drop table customer;