Please download the attachment

We will upload all assignment of MCA2 before 28th march

MCS013 - Assignment 8(d)




A function is onto if and only if for every y in the codomain, there is an x in the domain such that f(x)=y.
So in the example you give, f:RR,f(x)=5x+2, the domain and codomain are the same set: R. Since, for every real number yR, there is an xR such that f(x)=y, the function is onto. The example you include shows an explicit way to determine which x maps to a particular y, by solving for x in terms of y. That way, we can pick any y, solve for f(y)=x, and know the value of x which the original function maps to that y.
Side note:
Note that f(y)=f1(x) when we swap variables. We are guaranteed that every function f that is onto and one-to-one has an inverse f1, a function such that f(f1(x))=f1(f(x))=x.

#include<stdio.h>

#include<conio.h>

#include<string.h>

void main()

{

char str1[21],str2[21];

int i,j,a[20],b[20];

int add[21]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};


printf("\n Enter number 1:");

for(i=0; i<21; i++)

{

str1[i]=getchar();

}

printf("\n Enter number 2:");

for(i=0; i<21; i++)

{

str2[i]=getchar();

}


//converting char to integer

for(i=0; i<20; i++)

{

a[i]=(int)str1[i]-48;

b[i]=(int)str2[i]-48;

}

printf("\n Print Number 1:");

for(i=0; i<20; i++)

{

printf("%d",a[i]);

}

printf("\n Print Number 2:");

for(i=0; i<20; i++)

{

printf("%d",b[i]);

}

for(i=20; i>-1;i--)

{

j= a[i]+b[i];

if(j<10)

{

add[i] +=j;

}

else

{

add[i]+=(j-10);

add[i-1]+=1;

}

}

printf("\n Print Addition:");

for(i=0; i<20; i++)

{

printf("%d",add[i]);

}

 

getch();

}