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\left(x\right)=y$.
So in the example you give, $f:\mathbb{R}\to \mathbb{R},\phantom{\rule{1em}{0ex}}f\left(x\right)=5x+2$, the domain and codomain are the same set: $\mathbb{R}.\phantom{\rule{thickmathspace}{0ex}}$ Since, for every real number $y\in \mathbb{R},\phantom{\rule{thinmathspace}{0ex}}$ there is an $\phantom{\rule{thinmathspace}{0ex}}x\in \mathbb{R}\phantom{\rule{thinmathspace}{0ex}}$ such that $f\left(x\right)=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}^{\prime }\left(y\right)=x$, and know the value of $x$ which the original function maps to that $y$.
Side note:
Note that ${f}^{\prime }\left(y\right)={f}^{-1}\left(x\right)$ when we swap variables. We are guaranteed that every function $f$ that is onto and one-to-one has an inverse ${f}^{-1}$, a function such that $f\left({f}^{-1}\left(x\right)\right)={f}^{-1}\left(f\left(x\right)\right)=x$.

#include<stdio.h>

#include<conio.h>

#include<string.h>

void main()

{

char str1[21],str2[21];

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

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)

{

}

else

{

}

}

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

{