jara

11ove11beFri, 28 Nov 2008 03:33:35 +0000 28,2008

Filed under: Program 1 - Administrator @ 3:33 am

#include<stdio.h>

#include<conio.h>

#include <stdlib.h>

int main(){

    int accountN[5];

    float balance[5];

    float charges[5];

    float credits[5];

    float creditL[5];

    float nBalance[5];

    int x;

    for(x=0 ;x<5;x++){

            printf("Enter Account Number(-1 to end): ");

            scanf("%d",&accountN[x]);

            // for -1 input

            if(accountN[x]== -1){

                             getch();

                             break;

            }

            printf("Enter Beginning Balance: ");

            scanf("%f",&balance[x]);

            printf("Enter Total Charges: ");

            scanf("%f",&charges[x]);

            printf("Enter Total Credits: ");

            scanf("%f",&credits[x]);

            printf("Enter Credit Limit: ");

            scanf("%f",&creditL[x]);

            nBalance[x] = balance[x] + charges[x] - credits[x];

            printf("\n");

            if(nBalance[x] > creditL[x]){

                           printf("\n");

                           printf("\n");

                        printf("\nAccount:\t %d", accountN[x]);

                        printf("\nCredit Limit:\t %.2f ",creditL[x] );

                        printf("\nBalance:\t %.2f", nBalance[x]);

                        printf("\nCredit Limit Exceeded.\n");

                        printf("\n");

                        printf("\n");

            }

    }

}

Comments »

The URI to TrackBack this entry is: http://jarah.blogsome.com/2008/11/28/5/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Get free blog up and running in minutes with Blogsome
Theme designed by Janis Joseph