Professional Documents
Culture Documents
LAB3
LAB3
#include <bits/stdc++.h>
double f,s,t;
if(*a>=*b)
if(*a>=*c)
t = *a;
if(*c>=*b)
s = *c;
f = *b;
else
f = *c;
s = *b;
}
else
f = *b;
s = *a;
t = *c;
else
if(*b>=*c)
t = *b;
if(*c>=*a)
s = *c;
f = *a;
else
f = *c;
s = *a;
}
}
else
t = *c;
s = *b;
f = *a;
*a = f;
*b = s;
*c = t;
int main()
double n1,n2,n3;
cin>>n1;
cin>>n2;
cin>>n3;
valueSwap(&n1,&n2,&n3);
}
7. Write a program that reads characters from the standard input to end-of-file. For each
character, have the program report whether it is a letter. If it is a letter, also report its numerical
location in the alphabet. For example, c and C would both be letter 3. Incorporate a function
that takes a character as an argument and returns the numerical location if the character is a
letter and that returns –1 otherwise.
11. Write and test a Fibonacci() function that uses a loop instead of recursion to calculate
Fibonacci numbers.