0% found this document useful (0 votes)
24 views

Manipal International University School of Science and Engineering I Sem B.E Computer Programming-Assignment

This document contains 10 programming assignments for students in the first semester of the computer engineering program at Manipal International University. The assignments include writing programs to calculate employee gross salary based on salary brackets, find the sum of digits in a number, check if a number is divisible by 100, perform arithmetic operations on variables with increment/decrement operators, find prime numbers between two values, analyze arrays of numbers, use structures to store and display employee data, merge sorted arrays, demonstrate passing structures to functions by reference, and check if a year is a leap year.

Uploaded by

tevya
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Manipal International University School of Science and Engineering I Sem B.E Computer Programming-Assignment

This document contains 10 programming assignments for students in the first semester of the computer engineering program at Manipal International University. The assignments include writing programs to calculate employee gross salary based on salary brackets, find the sum of digits in a number, check if a number is divisible by 100, perform arithmetic operations on variables with increment/decrement operators, find prime numbers between two values, analyze arrays of numbers, use structures to store and display employee data, merge sorted arrays, demonstrate passing structures to functions by reference, and check if a year is a leap year.

Uploaded by

tevya
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

MANIPAL INTERNATIONAL UNIVERSITY

SCHOOL OF SCIENCE AND ENGINEERING


I SEM B.E
COMPUTER PROGRAMMING-ASSIGNMENT

1. Accept the salary of an employee from the user. Calculate the gross salary on the
following basis:

Basic HRA DA .

1 - 4000 10% 50%


4001 - 8000 20% 60%
8001 - 12000 25% 70%
12000 and above 30% 80%

2. Write a C program to find the sum of individual digits in a number


3. Accept any number from the user. Display whether the number is divisible by 100
or not.
4. For each of the following, ff the values of a=5, b=6 and c=4, find the value of
i. R= -a++ + c;
ii. R=a+b+c++;
iii. R= a*b/++c;
5. Write a C program to display all prime numbers between 5 and 150
6. Write a program to accept 10 values in an integer array. Display the total number of odd,
even, and negative numbers.
7. Create a structure to store the employee number, name, department and basic
salary. Create a array of structure to accept and display the values of 10
employees.
8. Write a C program to read two sorted arrays and to merge them into a single sorted array.
9. What does this program print in C?

#include <stdio.h>

struct integer {
int val;
};

static void bar(struct integer i) {


i.val = 5;
}

main(int argc, char *argv[]) {


struct integer n;
n.val = 1;
bar(n);
printf("%d\n", n.val);
}

10. Write a C program to check whether the year is leap year or not.(hint: use modulus %
operator)

You might also like