You are on page 1of 14

******INPUT******

Enter String: HELLOWORLD


******OUTPUT******
Final String: GDKKNVNQKC
******INPUT******
Enter Full Name: Mahendra Singh Dhoni

******OUTPUT******
Final String: M.S.Dhoni
******INPUT******
Enter the number: 987654321

******OUTPUT******
Reverse of the number is : 123456789
***INPUT***
Enter name of the employee: Devashish

Enter salary and working hours of the employee: 2500 20

Enter name of the employee: Tushar

Enter salary and working hours of the employee: 30000 15

Enter name of the employee: Shubham

Enter salary and working hours of the employee: 1200 18

Enter name of the employee: Piyush

Enter salary and working hours of the employee: 1000 20

Enter name of the employee: Rishabh

Enter salary and working hours of the employee: 1100 16

Enter name of the employee: Priyanshu

Enter salary and working hours of the employee: 17000 8

Enter name of the employee: Chaitanya

Enter salary and working hours of the employee: 23000 12


Enter name of the employee: Ankit

Enter salary and working hours of the employee: 1990 5

Enter name of the employee: Dhruv

Enter salary and working hours of the employee: 1000 7

Enter name of the employee: abhinav

Enter salary and working hours of the employee: 5600 14

***OUTPUT***
Name of the employee is: Devashish

New salary is: 10000.000000


Name of the employee is: Tushar

New salary is: 37500.000000


Name of the employee is: Shubham

New salary is: 8700.000000


Name of the employee is: Piyush

New salary is: 8500.000000


Name of the employee is: Rishabh
New salary is: 8600.000000
Name of the employee is: Priyanshu

New salary is: 19500.000000


Name of the employee is: Chaitanya

New salary is: 30500.000000


Name of the employee is: Ankit

New salary is: 1990.000000


Name of the employee is: Dhruv

New salary is: 1000.000000


Name of the employee is: abhinav

New salary is: 13100.000000


***INPUT***
Enter elements: 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
38 39 40

***OUTPUT***
23 29 31 37
20 21 22 24 25 26 27 28 30 32 33 34 35 36 38 39
***INPUT***
Enter the content: Coding is satisfaction

Enter the character :i

***OUTPUT***
Coding is satisfaction
The positions are: 3 7 13 19
******INPUT******
Enter a number for which the factorial to be calculated: -5
******OUTPUT******
Number is negative. Factorial can't be calculated.

******INPUT******
Enter a number for which the factorial to be calculated: 0
******OUTPUT******
Factorial of zero is 0.

******INPUT******
Enter a number for which the factorial to be calculated: 5
******OUTPUT******
Factorial of 7 is 5040
***INPUT***

Enter the age of first person : 25


Enter the age of second person : 35
Enter the age of third person : 45
***OUTPUT***

Third person is the oldest


First person is the youngest

***INPUT***

Enter the age of first person : -12


Enter the age of second person : 24
Enter the age of third person : 88
***OUTPUT***

Age must be a positive value

***INPUT***

Enter the age of first person : 24


Enter the age of second person : 24
Enter the age of third person : 36
***OUTPUT***

Third person is the oldest


First and Second person are of same age
***INPUT***
first string must be entered: silent
second string must be entered: listen
***OUTPUT***

The two entered strings are Anagram

***INPUT***
first string must be entered: coding
second string must be entered: gingid
***OUTPUT***

The two entered strings are not Anagram


***INPUT***
first string must be entered: computer
second string must be entered: retupmocm

same number of characters must be present in both the strings to be an


Anagram
/*******************************************************************************
Name : Tushar Kukreti
Section : L
Roll No : 2019190
*******************************************************************************

7.WAP to add elements of two unequal size array into 3 rd array using
Dynamic Memory Allocation. */

#include <stdio.h>
#include <stdlib.h>
void main()
{
int *p1,*p2,*p3,m,n,i,max;
printf("\t\t\t****INPUT****\n");
printf("Enter the size of first array\n");
scanf("%d",&m);
p1 = (int*)calloc(m,sizeof(int));
printf("Enter the elements in the array\n");
for(i=0;i<m;i++)
scanf("%d",p1+i);
printf("Enter the size of the second array\n");
scanf("%d",&n);
p2 = (int*)calloc(n,sizeof(int));
printf("Enter the elements in the array\n");
for(i=0;i<n;i++)
scanf("%d",p2+i);
max = (n>m)?n:m;
p3 = (int*)calloc(max,sizeof(int));
printf("\t\t\t****OUTPUT****\n");
for(i=0;i<max;i++)
{
*(p3+i) = *(p1+i) + *(p2+i);
printf("%d ",*(p3+i));
}
}
****INPUT****
Enter the size of first array
5
Enter the elements in the array
12345
Enter the size of the second array
6
Enter the elements in the array
123456
****OUTPUT****
2 4 6 8 10 6

You might also like