Get Email Subscription

Enter your email address:

Delivered by FeedBurner

Showing posts with label Important Program. Show all posts
Showing posts with label Important Program. Show all posts

Sunday, April 11, 2010

Input total marks and display grade. Grade is calculated as follows.

 Input total marks and display grade. Grade is calculated as follows.

Total Marks Income Tax
>=360 First class
< 360 but >=270 Second class
< 270 but >=210 Pass class
<210 Fail


#include<stdio.h>
#include<conio.h>
#include<math.h>
void main( )
{
int tm;
printf("Enter Value of X");
scanf("%d", &tk);

if (tm >= 360)
  printf("Grade is First Class\n");
else
  if (tm >=270)
    printf("Grade is Second Class\n");
  else
      if (tm <= 210)
         printf("Grade is Pass Class");
      else
        printf("Grade is Fail\n");
getch( );
}


Dell Inspiron 545 i545-2062NBK Desktop PC with 21.5-Inch Flat Panel Monitor (Piano Black)Dell 3.0 Ghz. Super Fast GX Computer with Dell LCD Flat Monitor, Huge 500GB Hard Drive, 4GB RAM, DVD Burner (DVD-RW), and New Licensed Windows XP with Genuine Microsoft Authorized CDHP Pavilion Slimline S5220F Black Desktop PC (Windows 7 Home Premium)
read more "Input total marks and display grade. Grade is calculated as follows."

Input Basic Salary. Find and display Income Tax. Income Tax is calculated as follows:

Input Basic Salary. Find and display Income Tax. Income Tax is calculated as follows:

Basic Salary Income Tax
First 1000 Nil
Next 15 5%
Rest 10%



#include<stdio.h>
#include<conio.h>
void main( )
{
float bs, it;

clrscr( );
printf("Enter Basic Salary");
scanf("%f", &bs);
if (bs < 1000)
  it = 0;
else
  if (bs < 2500)
    it = (bs - 1000)*5/100;
  else
    it = 75 + (bs - 2500)*10/100;
printf("\n Income Tax is = %.2f\n", it);
getch( );
}

New Balance Men's MR993 Running ShoeSkechers Men's Shape Ups Lace-UpSkechers Women's Shape Ups - Strength Fitness Walking SneakerASICS Men's GT-2140 Running Shoe
read more "Input Basic Salary. Find and display Income Tax. Income Tax is calculated as follows:"

Input sales. Find and print commission. Commission is calculated as follows:

 Turquoise Zebra Stripe Wrist Watch
Input sales. Find and print commission. Commission is calculated as follows:
SALES Commission
<=10000 1%
>10000 but <=30000 5%
Rest 10%


#include<stdio.h>
#include<conio.h>
void main( )
{
float s, c;

clrscr( );
printf("Enter Sales");
scanf("%f", &s);
if (s<10000)
  c=s*1/100;
else
  if(s < 30000)
    c=s*5/100;
else
    c=s*10/100;
printf("/n Commission is =%.2f", c);
getch( );
}

White Ceramic Style Watch with Matching Strap and Face and Sparkly Clear RhinestonesCasio Men's Sea Analog Illuminator Dual LED Dive Watch #MDV102-1AVInvicta Men's Pro Diver Stainless Steel Silver Dial Watch #5249STimex Kids' Camouflage Stretch Band Watch #T78141Skagen Women's Silver Dial Mesh Bracelet Watch #358SSSD
read more "Input sales. Find and print commission. Commission is calculated as follows:"

Sunday, April 4, 2010

To input an integer and print whether it is a prime number or not.

Dell D600 Laptop 1.6ghz 40gb DVD/CDRW B Grade Includes Genuine XP Professional restore cd!Write a program in C to input any positive integer and to print whether it is a prime number or not.
Toshiba Satellite L505-GS5037 TruBrite 15.6-Inch Laptop (Black)

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main( )
{
int i, m, nd;

nd=0;
printf("Enter a positive integer\n");
scanf("%d", &m);
for(i=1; i<=m; i++)
{
if(m % i = = 0)
nd++;
}
if(nd ==2)
printf("%d is a prime number\n", m);
else
printf("%d is not a prime number\n",m);

}

M810 Watch Phone with 2 Stylus Pens
read more "To input an integer and print whether it is a prime number or not."

Thursday, March 11, 2010

Find highest, median and lowest number from the given set of 17 numbers.

The Big Short: Inside the Doomsday Machine
Write a program in C to input 17 observation and then print highest, median and lowest.
#include<stdio.h>
#define N 17
void main( )
{
int i, j, n[N], t;
printf("Enter %d integer values\n", N);
for (i=0; i < N; i++) scanf("%d", &n[i]); for(i=0; i < N-1; i++) for (j=i+1; j < N; j++) if (n[i] > n[j])
{
t = n[i];
n[i] = n[j];
n[j] = t;
}
printf("Highest number is %d", n[16]);
printf("Median is %d\n", n[8]);
printf("Lowest number is %d", n[0]);
getch( );
}
read more "Find highest, median and lowest number from the given set of 17 numbers."

Find the highest and lowest number from the given set of 13 numbers.

Write a program in C to input 13 observation and then print Highest and Lowest.


#include<stdio.h>
#define N 13
void main( )
{
int i, j, n[N], t;
printf("Enter %d integer values\n", N);
for (i=0; i < N; i++)
scanf("%d", &n[i]);
for(i=0; i < N-1; i++)
for (j=i+1; j < N; j++)
if (n[i] > n[j])
{
t = n[i];
n[i] = n[j];
n[j] = t;
}
printf("Highest number is %d", n[12]);
printf("Lowest number is %d", n[0]);
getch( );
}
read more "Find the highest and lowest number from the given set of 13 numbers."

Input 10 numbers. Find the lowest number from the given set of 10 numbers.

Write a program in C to input 10 observation and then print Lowest.


#include<stdio.h>
#define N 10
void main( )
{
int i, j, n[N], t;
printf("Enter %d integer values\n", N);
for (i=0; i < N; i++)
scanf("%d", &n[i]);
for(i=0; i < N-1; i++)
for (j=i+1; j < N; j++)
if (n[i] > n[j])
{
t = n[i];
n[i] = n[j];
n[j] = t;
}
printf("Lowest number is %d", n[0]);
getch( );
}

read more "Input 10 numbers. Find the lowest number from the given set of 10 numbers."

Input 25 numbers. Find the largest number from the given set of 25 numbers.

Write a program in C to input 25 observation and then print Highest.


#include<stdio.h>
#define N 25
void main( )
{
int i, j, n[N], t;
printf("Enter %d integer values\n", N);
for (i=0; i < N; i++)
scanf("%d", &n[i]);
for(i=0; i < N-1; i++)
for (j=i+1; j < N; j++)
if (n[i] > n[j])
{
t = n[i];
n[i] = n[j];
n[j] = t;
}
printf("Highest number is %d", n[24]);
getch( );
}
read more "Input 25 numbers. Find the largest number from the given set of 25 numbers."

Input 15 numbers. Arrange the numbers in ascending order and display the median of the same.

Write a program in C to accept 15 numbers, arrange these numbers in ascending order, display the median of the same.


#include< stdio.h>
#define N 15
void main( )
{
int i, j, n[N], t;
printf("Enter %d integer values\n", N);
for (i=0; i < N; i++)
scanf("%d", &n[i]);
for(i=0; i < N-1; i++)
for (j=i+1; j < N; j++)
if (n[i] > n[j])
{
t = n[i];
n[i] = n[j];
n[j] = t;
}
printf("Median is %d\n", n[7]);
getch( );
}
read more "Input 15 numbers. Arrange the numbers in ascending order and display the median of the same."

Input 20 numbers. Arrange the numbers in ascending order and display ascending order as well as descending order list.

Write a program in C to input 20 integers and then print these integers in ascending order of magnitude and then in descending order of magnitude.


#include<stdio.h>
#define N 20
void main( )
{
int i, j, n[N], t;
printf("Enter %d integer values\n", N);
for (i=0; i < N; i++)
scanf("%d", &n[i]);
for(i=0; i < N-1; i++)
for (j=i+1; j < N; j++)
if (n[i] > n[j])
{
t = n[i];
n[i] = n[j];
n[j] = t;
}
printf("The ascending order is \n");
for (i=0; i < N; i++)
printf("%d\t", n[i]);
printf("The descending order is \n");
for (i=N-1; i > = 0; i--)
printf("%d", n[i]);
getch( );
}
read more "Input 20 numbers. Arrange the numbers in ascending order and display ascending order as well as descending order list."

Input 20 numbers. Arrange the numbers in descending order and display descending order. (Sorting of an array)

Write a program in C accept 20 integers and arrange them in the descending order of values.(Sorting of an array)


#include<stdio.h>
#define N 20
void main( )
{
int i, j, n[N], t;
printf("Enter %d integer values\n", N);
for (i=0; i < N; i++)
scanf("%d", &n[i]);
for(i=0; i < N-1; i++)
for (j=i+1; j < N; j++)
if (n[i] < n[j])
{
t = n[i];
n[i] = n[j];
n[j] = t;
}
printf("The descending order is \n");
for (i=0; i < N; i++)
printf("%d\t", n[i]);
getch( );
}
read more "Input 20 numbers. Arrange the numbers in descending order and display descending order. (Sorting of an array)"

Input 10 numbers. Arrange the numbers in ascending order and display ascending order. (Sorting of an array)

Write a program in C accept 10 integers and arrange them in the ascending order of values.(Sorting of an array)


#include<stdio.h>
#define N 10
void main( )
{
int i, j, n[N], t;
printf("Enter %d integer values\n", N);
for (i=0; i < N; i++)
scanf("%d", &n[i]);
for(i=0; i < N-1; i++)
for (j=i+1; j < N; j++)
if (n[i] > n[j])
{
t = n[i];
n[i] = n[j];
n[j] = t;
}
printf("The ascending order is \n");
for (i=0; i < N; i++)
printf("%d\t", n[i]);
}
read more "Input 10 numbers. Arrange the numbers in ascending order and display ascending order. (Sorting of an array)"

Wednesday, March 10, 2010

Calculation of depreciation , by using Written Down Value ( WDV ) as well as Straight Line Method ( SLM ).

Enter cost, rate of depreciation and number of years. Display depreciation for each year by WDV method as well as by Straight Line Method.


#include<stdio.h>
#include<conio.h>
void main( )
{
float cost, rate, year, slmdep, wdvdep, cnt;
clrscr( );
printf("Enter Cost, Dep.Rate, Years");
scanf("%f %f %f", &cost, &rate, &year);
slmdep = cost*rate/100;
for (cnt=1; cnt < = year; cnt++)
{
wdvdep = cost*rate/100;
cost = cost - wdvdep;
printf("\n Year %f, WDV Dep %.2f, SLM Dep %.2f\n", cnt, wdvdep,slmdep);
}
getch( );
}


read more "Calculation of depreciation , by using Written Down Value ( WDV ) as well as Straight Line Method ( SLM )."

Calculation of depreciation by using straight Line method ( SLM )

Enter cost, rate of depreciation and number of years. Display depreciation for each year by straight line method.


#include<stdio.h>
#include<conio.h>
void main( )
{
float cost, rate, year, dep, cnt;
clrscr( );
printf("Enter Cost, Dep.Rate, Years");
scanf("%f %f %f ", &cost, &rate, &year);
dep = cost*rate/100;
for(cnt=1; cnt < = year; cnt++)
{
printf("\n Year %f, Depreciation %.2f\n", cnt, dep);
}
getch( );
}
read more "Calculation of depreciation by using straight Line method ( SLM )"

Calculation of depreciation by using WDV method

Enter cost, rate of depreciation and number of years. Display depreciation for each year by WDV method.


#include<stdio.h>
#include<conio.h>
void main( )
{
float cost, rate, year, dep, cnt;
clrscr( );
printf("Enter Cost, Dep.Rate, Years");
scanf("%f %f %f", &cost, &rate, &year);
for (cnt=1; cnt < = year; cnt++)
{
dep = cost*rate/100;
cost = cost - dep;
printf("\n Year %f, Depreciation %.2f\n", cnt, dep);
}
getch( );
}
read more "Calculation of depreciation by using WDV method"

Calculation of depreciation , by using WDV method & scrap value at the end

Write a program in C which will get from the keyboard information about the name of the asset for which depreciation is to be calculated according to diminishing balance method. The operator should also give detail about the cost price of the asset and the rate of depreciation and number of years indicating the life of the asset. The output must show year number (real), value of the asset of that year, depreciation for the year and at end it should indicate the scrap value of the asset.


#include<stdio.h>
#include<conio.h>
void main( )
{
char asset_name[25];
float cost, rate, year, dep, cnt;
clrscr( );
printf("Enter Name of asset, cost, Dep, Rate, Life of asset");
scanf("%s %f %f %f", asset_name, &cost, &rate, &year);
for (cnt=1; cnt < = year; cnt++)
{
dep = cost*rate/100;
printf("\n Year %.0f, Cost this year %.2f, Depreciation %.2f\n", cnt, cost, dep);
cost = cost - dep;
}
printf("Scrap value %.2f\n", cost);
getch( );
}
read more "Calculation of depreciation , by using WDV method & scrap value at the end"

Find the GCD of two positive integer.

Find the G.C.D of two positive integer.


#include<stdio.h>
#include<conio.h>
void main( )
{
int a, b;
clrscr( );
printf("Enter any two positive integer\n");
scant("%d %d", &a, &b);
while (a!=b)
{
if (a > b)
a = a - b;
else
b = b - a;
}
printf("The gcd is %d \n", a);
}
read more "Find the GCD of two positive integer."

Write a program in c ( WAPIC ) to input salesman name and his total sales and print his name, his commission and the additional commission.

A chemical co. offers commission to their salesman at rate of 5% of the total sales amount in order to increase the sales, the company offers an additional commission at 3% of the amount exceeding Rs. 10,000.
Write a prWrite a proogram in c ( WAPIC ) to input salesman name (sn) and his total sales (ts) and print his name, his commission (c) and the additional commission (ac).



#include<stdio.h>
void main( )
{
char sn[25];
float ts, c, ac;
printf("Enter the salesman name and his total sales\n");
scanf("%s %f", sn, &ts);
c = ts*0.05;
if (ts > 10000)
ac = (ts - 10000)*0.03;
else
ac = 0;
printf("Salesman name is %s \n", sn);
printf("His commission is Rs %f \n", c);
printf("The additional commission is Rs %f \n", ac);
}

read more "Write a program in c ( WAPIC ) to input salesman name and his total sales and print his name, his commission and the additional commission."

Monday, January 4, 2010

Write a program in 'C' to test whether the given integer is even or odd and to print message accordingly.(Using if...........else statement.)

 Toshiba Satellite L505-GS5037 TruBrite 15.6-Inch Laptop (Black)
HP 2009M 20-Inch HD LCD Monitor
#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
int n;
printf("Enter any integer\n");
scanf("%d", &n);
if(n % 2 = = 0)
printf("The integer %d is even \n", n);
else
printf("The integer %d is odd \n", n);
return(0);
}


Samsung 2233SW 21.5-Inch Full HD Widescreen LCD Monitor
For eg :-

Output :-
Enter any integer
25
The integer 25 is odd

Output :-
Enter any integer
10
The integer 10 is even

ViewSonic VA2223wm 22-Inch 16:9 1080p LCD Monitor
read more "Write a program in 'C' to test whether the given integer is even or odd and to print message accordingly.(Using if...........else statement.)"

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP