[ create a new paste ] login | about

Link: http://codepad.org/b9WzgYkx    [ raw code | output | fork ]

C, pasted on Apr 21:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>

int main()
{
    int kg, fr;
    float div;
    printf("Enter total kgs of cake");
    scanf("%d", &kg);
    printf("\nHow many friends Babulu has?");
    scanf("%d", &fr);
    div = kg/fr;
    printf("\nBabulu has to distribute %.1f", div ," kg to each of his %d",fr,"friends.");
    
    return 0;
}


Output:
1
2
3
Enter total kgs of cake
How many friends Babulu has?
Babulu has to distribute -131.0


Create a new paste based on this one


Comments: