0% found this document useful (0 votes)
8 views3 pages

C Programming Basics: Character & Salary

The document contains three practical programming exercises in C. Practical 1 checks if an entered character is a lowercase letter, uppercase letter, digit, or special character. Practical 2 finds the largest of three entered numbers, and Practical 3 calculates the gross salary based on a given basic salary with different allowances.

Uploaded by

msi.college101
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

C Programming Basics: Character & Salary

The document contains three practical programming exercises in C. Practical 1 checks if an entered character is a lowercase letter, uppercase letter, digit, or special character. Practical 2 finds the largest of three entered numbers, and Practical 3 calculates the gross salary based on a given basic salary with different allowances.

Uploaded by

msi.college101
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Practical 1

# include <stdio.h>

int main (){

char ch;

printf(" Enter a character: ");

scanf("%c", & ch);

if( ch>= 'a' && ch<='z')

printf ("The Entered Character is Small \n");

else if ( ch >='A'&& ch<='Z')

printf("The Entered Character is Big \n");

else if (ch>='0'&& ch<='9')

printf("The Entered Character is Digit \n");

else

printf("The Entered Character is Special Character \n");

return 0;

}
Practical 2
# include <stdio.h>

int main (){

int a,b,c, large;

printf(" Enter Three Numbers: ");

scanf("%d %d %d",&a, &b, &c);

large = (a>b)? ((a>c)? a:c) : ((b>c)? b:c );

printf(" The Largest Number is %d", large);

return 0;

Practical 3
#include <stdio.h>

int main() {

float basic, hra, da, gross;

printf("Enter Basic Salary: ");

scanf("%f", &basic);

if (basic < 1500) {

hra = 0.10 * basic;

da = 0.90 * basic;

} else {

hra = 500;

da = 0.98 * basic;

gross = basic + hra + da;

printf("Gross Salary = %.2f\n", gross);

return 0;

You might also like