Coder Social home page Coder Social logo

ia1-revision's Introduction


1. Add two numbers using 4 functions and Pass by reference
void input(int *a, int *b);
void add(int a, int b, int *sum);
void output(int a, int b, int sum);
input:
1
2
output:
sum of 1+2 is 3


2. Write a program to find largest of 3 numbers using 4 functions using Pass by value
int input()
int cmp(int a, int b, int c)
void output(int a, int b, int c, int largest)


3. Write a program to find Sum of n numbers
a. Sum of n numbers
int input_n();
int sum_n(int n);
void output(int n, int sum);
input:
5
output:
1+2+3+4+5 is 15


4. Write a program to find Sum of n different number entered by the user
int input_array_size();
void input_array(int n, int a[n]);
int sum_n_arrays(int n, int a[n]);
void out_put(int n, int a[n], int sum);
input:
1 7 11
output:
1+7+11 is 19
5. Write a program to find the square root of a number.
float input();
float my_sqrt(float n);
void output(float n, float sqrt_result);


6. Write a program to Compare two strings. Do not use string handling functions from standard library.
void input_two_string(char *a, char *b);
int strcmp(char *a, char *b);
void output(char *a, char *b, int result);
input:
hello
world
output:
world is greater than hello


7. Write a program to find Sum of two complex numbers
struct _complex
{
float real,imaginary;
}; <brtypedef _complex Complex
Complex input_complex();
Complex add(Complex a, Complex b);
void output(Complex a, Complex b, Complex c);
input:
2 3
4 5
output
2 + 3i + 4 + 5i is 6 + 8i

8. Write a program to find Sum of n complex numbers
struct _complex
{
float real,imaginary;
};
typedef _complex Complex;
int get_n();
Complex input_complex();
void input_n_complex(int n, Complex c[n]);
Complex add(Complex a, Complex b);
Complex add_n_complex(int n, Complex c[n]);
void output(int n, Complex c[n], Complex result);
input:
2
2 + 3i
4 + 5i
output:
2 + 3i
+ 4 + 5i is
6 + 8i

ia1-revision's People

Contributors

srinirad avatar keerthikps avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.