This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Detailed Software Testing Tutorials and Interview Questions.

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Detailed Software Testing Tutorials and Interview Questions.3

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Detailed Software Testing Tutorials and Interview Questions.3

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Detailed Software Testing Tutorials and Interview Questions.3

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Detailed Software Testing Tutorials and Interview Questions.3

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

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 is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Sunday 26 August 2012

Calculating Grand Total on Discount


#include <stdio.h>
#include <conio.h>

void main()
{
                clrscr();

                int a, b, c, d, e;
                float total, discount, discountAmt, grandTotal;

                printf("Enter the 1st amount : ");
                scanf("%d",&a);

                printf("Enter the 2nd amount : ");
                scanf("%d",&b);

                printf("Enter the 3rd amount : ");
                scanf("%d",&c);

                printf("Enter the 4th amount : ");
                scanf("%d",&d);

                printf("Enter the 5th amount : ");
                scanf("%d",&e);

                total = a+b+c+d+e;

                printf("\n\nTotal = Rs. %.f",total);

                if(total>5000)
                {
                                discount = 5;
                }
                else
                {
                                discount = 3;
                }

                printf("\n\nYou will get %.f discount.",discount);

                discountAmt = ((float) discount/100) * total;

                grandTotal = total - discountAmt;

                printf("\n\nDiscount Amount = Rs. %.f",discountAmt);

                printf("\n\Total Amount =  Rs. %.f",grandTotal);

                getch();
}

Convert Character to ASCII Code


#include <stdio.h>
#include <conio.h>

void main()
{
                char a;
                clrscr();

                printf("Enter a character : ");
                scanf("%c",&a);

                printf("ASCII code of %c is %u",a,a);

                getch();
}