Dremendo Tag Line

Print 12 pens cost price in C

printf() - Question 13

In this question, we will see how to print the cost of 12 pens if the cost of one pen is Rs. 14 in C programming using the printf() function. To know more about printf() function click on the printf() function lesson.

Q13) Write a program in C to print the cost of 12 pens if the cost of one pen is Rs. 14.

Program

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

int main()
{
    printf("Cost of 1 pen = Rs.14\n");
    printf("Cost of 12 pens = Rs.%d",12*14);
    return 0;
}

Output

Cost of 1 pen = Rs.14
Cost of 12 pens = Rs.168
video-poster