Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary Worksheet on basic Computer Proramming (C language) exercise

Rating
-
Sold
-
Pages
34
Uploaded on
19-04-2022
Written in
2019/2020

This file consists of basic programming codes written in the C language. The codes start from "writing your own name in the form of output to making a program for input swap, calculations, formula-based programs, writing character strings", and many more. I have included more than 30 examples for practice purposes. If you want to practice your coding skills and need help from the get go, this file is for you. I hope this helps you with your purpose!

Show more Read less
Institution
Course

Content preview

Computer Programming ( C Language )


*Declaration: I thereby declare that all the content within this file is not copied and had done directly by
me during my coursework in college

Content list.

1) Write a program to calculate salary of an employee, given his basic pay (to be entered by the
user). HRA is 10% of the basic pay; TA is 5% of the basic pay. Calculate the Gross salary of an
employee.

2) Write a program to calculate the area and circumference of a circle.

3) Write a program to enter any alphabet in small case and display it in upper case.

4) Write a program to enter any alphabet in upper case and display it in lower case.

5) Write a program to read roll no., age, and gender of a student and display the details of a student
with proper headline for each variable.

6) Write a program to convert degree Fahrenheit into degree Celsius.

7) Write a program to check whether the given number is even or odd.

8) Write a program to check whether the given number is positive, negative or zero.

9) Write a program to find the greatest of three numbers.

10) Write a program to check whether the input character entered by user is lower case, upper case,
digit or special symbol.

11) Write a program to find profit and loss for a given cost price and selling price.

12) Implement calculation with following functionality: Addition, Subtraction, Multiplication,
Division, using switch case.

13) Write a program to print a multiplication table of any number.

14) Write a program to find a reverse of a given number.

15) Write a program to find the sum and multiplication of individual digits of the entered number.

16) Write a program to check whether the given number is Armstrong number or not.

17) Write a program to check whether the given number is palindrome number or not.

18) Write a program to find the Factorial of a given number.


Computer Programming (C language) Page 1

, 19) Write a program to find the Fibonacci series of n numbers entered by the user.

20) Write a program to print the Floyd's triangle.

21) Write a program to find the sum of marks of n students using array.

22) Write a program to find the addition of two 2-Dimensional matrixes.

23) Write a program to find the multiplication of two 2-Dimensional matrixes.

24) Write a program to enter your name and print it.

25) Write a program to enter any sentence and find out its total length.

26) Write a program to enter any string and print its reverse.

27) Write a program to enter any string and find the number of vowels and consonants in it.

28) Write a program to enter any string and find out how many times a particular character is present
in it.

29) Write a program to enter any two strings and concatenate those two strings.

30) Write a Program to swap two numbers using call by value.

31) Write a Program to swap two numbers using call by reference.

32) Write a Program to Write a string in the file named in-file and then read the string from it
convert it to upper case and write it to out-file.




Computer Programming (C language) Page 2

, EXPERIMENT – 1
AIM: Write a program to calculate salary of an employee, given his basic pay (to
be entered by the user). HRA is 10% of the basic pay; TA is 5% of the basic pay.
Calculate the Gross salary of an employee.

Coding:
#include<stdio.h>

#include<stdio.h>

void main()

{

float BS,GS,TA,HRA;

clrscr();

printf("\n Enter the basic salary of an employee");

scanf("%f",&BS);

TA=BS*5/100;

HRA=BS*10/100;

GS=BS+TA+HRA;

printf("\n The Gross salary of an employee is %f",GS);

getch();

}

Output:




:


Computer Programming (C language) Page 3

, EXPERIMENT - 2
AIM: Write a program to calculate the area and circumference of a circle.

Coding:
#include<stdio.h>

#include<conio.h>

void main()

{

float a,area,circum;

clrscr();

printf("\n Enter the radius of a circle, ");

scanf("%f",&a);

area= a*a*3.14;

circum= 2*3.14*a;

printf("\n The area of a circle is %f",area);

printf("\n The circumference of a circle is %f",circum);

getch();

}

Output:




Computer Programming (C language) Page 4

Written for

Course

Document information

Uploaded on
April 19, 2022
Number of pages
34
Written in
2019/2020
Type
SUMMARY

Subjects

$4.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
Manizaq

Get to know the seller

Seller avatar
Manizaq Gd Goenka University
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
4 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions