Get Email Subscription

Enter your email address:

Delivered by FeedBurner

Thursday, December 31, 2009

Write a program in 'C' to enter sales man name and sales. Find and print commission where comm = 4% on sales



#include<stdio.h>
main()
{
char name [25];
float comm, sales;
printf("Enter name of sales man and sales\n");
scanf("%s %f", name, &sales);
comm = sales*4/100;
printf("The commission is %f", comm);
return(0);
}

For eg :-

Output :-
Enter name of sales man and sales
Fransis 10000
The commission is 400.000000
read more "Write a program in 'C' to enter sales man name and sales. Find and print commission where comm = 4% on sales"

Write a program in 'C' to enter the base (b) and height (h) of a traingle and to calculate and print the area (a) where area = 1/2*base*height



#include<stdio.h>
main()
{
float b, h, a;
printf("Enter the value for base and height\n");
scanf("%f %f", &b, &h);
a = 0.5* b*h;
printf("The area is = %f\n", area);
return(0);
}

For eg :-

Output :-
Enter the value for base and height
5 8
The area is = 20.000000
read more "Write a program in 'C' to enter the base (b) and height (h) of a traingle and to calculate and print the area (a) where area = 1/2*base*height"

Write a program in 'C' to enter the radius and calculate and print the area of Circle using the formula area = TT * (radius)2, where TT = 3.14



#include<stdio.h>
main()
{
float r, a;
printf("Enter the value of radius\n");
scanf("%f", &r);
a = 3.14*r*r;
printf("The area is %f\n", a);
return(0);
}

For eg :-

Output :-
Enter the value of radius
5
The area is 78.50000
read more "Write a program in 'C' to enter the radius and calculate and print the area of Circle using the formula area = TT * (radius)2, where TT = 3.14"

Wednesday, December 30, 2009

write a program in 'C' to enter three integers and print the maximum integer?



#include<stdio.h>
main()
{
int a, b, c, max;
printf("Enter three integers\n");
scanf("%d %d %d", &a, &b, &c);
max = (a>b)?a:b;
max = (max>c)?max:c;
printf("The maximum integer is = %d\n", max);
return(0);
}

For eg :-

Output :-

Enter three integers
12 20 50
The maximum integer is = 50
read more "write a program in 'C' to enter three integers and print the maximum integer?"

write a program in 'C' to enter three integers and print the minimum integer?



#include<stdio.h>
main()
{
int a, b, c, min;
printf("Enter three integers\n");
scanf("%d %d %d", &a, &b, &c);
min = (a<
b)?a:b;
min = (min<
c)?min:c;
printf("The minimum integer is = %d\n", min);
return(0);
}

For eg :-

Output :-

Enter three integers
12 20 50
The minimum integer is = 12
read more "write a program in 'C' to enter three integers and print the minimum integer?"

Write a progam in 'C' to enter two integers and to print the minimum integers?

#include<stdio.h>
main()
{
int x, y, min;
printf("Enter two unequal integers\n");
scanf("%d %d", &x, &y);
min = (x>y)?y:x;
printf("The minimum integer = %d\n", min);
return(0);
}

For eg :-

Output :-

Enter two unequal integers
25 35
The minimum integer = 25
read more "Write a progam in 'C' to enter two integers and to print the minimum integers?"

Write a progam in 'C' to enter two integers and to print the maximum integers?

#include<stdio.h>
main()
{
int x, y, max;
printf("Enter two unequal integers\n");
scanf("%d %d", &x, &y);
max = (x>y)?x:y;
printf("The maximum integer = %d\n", max);
return(0);
}

For eg :-

Output :-

Enter two unequal integers
25 35
The maximum integer = 35
read more "Write a progam in 'C' to enter two integers and to print the maximum integers?"

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP