Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
import java.util.Scanner;
public class Fibonacci
{
public static void main(String args[])
{
System.out.println("Enter a number:");
Scanner Scan=new Scanner(System.in);
int n=Integer.parseInt(s.nextInt());
int a=-1;
int b=1;
int c=0;
System.out.println("The fibonacci series are:");
for(i=1;i<=n;i++)
{
c=a+b;
int temp=a;
a=b;
b=c;
System.out.println(c);
}
}
}
#include <stdio.h>
int main()
{
int x,y,z;
printf("enter an integer ");
scanf("%d", &x);
printf("enter an integer ");
scanf("%d", &y);
z=x+y;
printf("The sum is %d", z);
return 0;
}
//Lab 1- Bryan Regn
// Created 9/6/17 Last updated 9/9/17
//main
#include <stdio.h>
#include <math.h>
//main file used to check user inputs and call different mathmatical operations
int main()
{
return 0;
}
//math.c
//all the following functions require their specific Operator (+,-,*,/,%) and two integers to correctly call the function
//Adds two integers together prints back their sum
void add(num1, num2, Operator){
int sum = 0;
sum = num1 + num2;
printf(sum);
}
//subtracts two integers prints back the difference
void sub(num1, num2, Operator){
int difference = 0;
difference = num1 - num2;
printf(difference);
}
//multiplies together two integers prints back product
void mul(num1, num2, Operator){
int product = 0;
product = num1*num2;
printf(product);
}
//divides two integers prints back answer
void divide(num1, num2, Operator){
int division - 0;
division = num1/num2;
printf(division);
}
//divides two integers prints back remainder of answer
void modulus(num1, num2, Operator){
int result = 0; //remainder was a reserved word and didnt want to use that
result = num1%num2;
printf(result);
}
//Math.h
#ifndef MATH_H_
#define MATH_H_
//Part of your documentation should be listing the valid inputs and outputs for the functions you create.
int math(int num1, int num2, char Operator);
#endif
#include <stdio.h>
int main()
{
int n;
int m;
int cntr;
long long product;
FILE*ark = fopen("Tablas de Multiplicar.dat","w");
printf("¿Qué tabla de multiplicar desea conocer (Registre número)\n");
scanf("&d", m);
printf("¿Hasta qué número la desea calcular? (Registe número)\n");
scanf("%d", &n);
for (cntr = 1; n=1; n++)
{
product= m*n;
printf("%d %lld\n", cntr, product);
fprintf(ark, "%d %lld\n", cntr, product);
}
return 0;
}