Tuesday, 24 June 2025

C Programming Solved Problems Let us C Yashwant Kanitkar Chapter 1

 Q: (d) Temperature of a city in Fahrenheit degrees is input through the keyboard. Write a program to convert this temperature into Centigrade degrees.

#include <stdio.h>

int main()

{

    double f, c;

    printf("Enter temperature in Fahrenheit: ");

    scanf("%lf", &f);

    c=(f - 32) * 5.0 / 9.0;

    printf("%lf Fahrenheit is equal to %lf Celsius\n", f, c);

    return 0;

}



Download Source Code

Page : 1 2 3 4

Tuesday, 17 June 2025

C Programming Solved Problems Let us C Yashwant Kanitkar Chapter 1

Q: (c) If the marks obtained by a student in five different subjects are input through the keyboard, write a program to find out the aggregate marks and percentage marks obtained by the student. Assume that the maximum marks that can be obtained by a student in each subject is 100.

/*Q: (c) If the marks obtained by a student in five different subjects are input through the keyboard,

write a program to find out the aggregate marks and percentage marks obtained by the student.

Assume that the maximum marks that can be obtained by a student in each subject is 100.*/



#include<stdio.h>

#include<conio.h>

void main()

{

double m1,m2,m3,m4,m5,tot,per;

clrscr();

printf("Enter Marks in 5 Subjects out of 100 each\n");

printf("Enter Marks in Subject 1\n");

scanf("%lf",&m1);

printf("Enter Marks in Subject 2\n");

scanf("%lf",&m2);

printf("Enter Marks in Subject 3\n");

scanf("%lf",&m3);

printf("Enter Marks in Subject 4\n");

scanf("%lf",&m4);

printf("Enter Marks in Subject 5\n");

scanf("%lf",&m5);

tot=m1+m2+m3+m4+m5;

per=tot/5;

printf("Total Marks = %lf\n",tot);

printf("Percentage = %lf",per);

getch();

}






Page : 1 2 3 4

C Programming Solved Problems Let us C Yashwant Kanitkar Chapter 1

 Q: (b) The distance between two cities (in km.) is input through the keyboard. Write a program to convert and print this distance in meters, feet, inches and centimeters.


/*Q: (b) The distance between two cities (in km.) is input through the keyboard.

Write a program to convert and print this distance in meters, feet, inches and centimeters.*/

#include<stdio.h>

#include<conio.h>

void main()

{

double dkm,dm,dcm,dft,din;

clrscr();

printf("Enter Distance in KM");

scanf("%lf",&dkm);

dm=dkm*1000;

dcm=dm*100;

din=dcm*0.3937;

dft=dcm*0.0328;

printf("Distance in CM = %lf\n",dcm);

printf("Distance in Inches = %lf\n",din);

printf("Distance in Feet = %lf\n",dft);

printf("Distance in Meter = %lf",dm);

getch();

}









Download Source Code


Page : 1 2 3 4


Sunday, 15 June 2025

C Programming Solved Problems Let us C Yashwant Kanitkar Chapter 1

 Q: (a) Ramesh’s basic salary is input through the keyboard. His dearness 

allowance is 40% of basic salary, and house rent allowance is 20% of 

basic salary. Write a program to calculate his gross salary.

Solution:

/*(a) Ramesh’s basic salary is input through the keyboard. His dearness 

allowance is 40% of basic salary, and house rent allowance is 20% of 

basic salary. Write a program to calculate his gross salary.*/

#include<stdio.h>

#include<conio.h>

void main()

{

double b_sal,da,hra,g_sal;

clrscr();

printf("Enter basic salary");

scanf("%lf",&b_sal);

hra=0.20*b_sal;//House Rent Allowance

da=0.40*b_sal;//Dearness Allowance

g_sal=b_sal+da+hra;//Gross Salary

printf("Gross Salary = %lf",g_sal);

getch();

}

Output:



Download Source Code

Page : 1 2 3 4