未定义对'的引用;功能';在c中,函数已经定义 #包括 #包括 #包括 int算术(); int-two_变量(); int三_变量(); int平方(); int三角函数(); //声明所有主要函数 内部主(空){ 查尔j; int选择; printf(“输入模式\n 1.算术\t 2.三角\n 3.二次\t 4.两变量\n\t 5.三变量\n”); scanf(“%d”,选择(&S); 开关(选择){ 案例1:;算术();中断; 案例2:;三角函数();中断; 案例3:;二次();中断; 案例4:;双变量();中断; 案例5:;三个变量();中断; 默认值:printf(“错误”); } printf(“继续?是/否”); scanf(“%c”,j); 如果(j='y'){ int main(); } 返回0; } int算术(){ int temp1,i,a,n,c=0;//c表示调用函数的次数 float num[n]; 浮动ans=0; printf(“输入输入数量:\0.2t”); scanf(“%d”和“&n”); printf(“输入数字”); 对于(i=0;i
您正在程序中使用以下函数未定义对'的引用;功能';在c中,函数已经定义 #包括 #包括 #包括 int算术(); int-two_变量(); int三_变量(); int平方(); int三角函数(); //声明所有主要函数 内部主(空){ 查尔j; int选择; printf(“输入模式\n 1.算术\t 2.三角\n 3.二次\t 4.两变量\n\t 5.三变量\n”); scanf(“%d”,选择(&S); 开关(选择){ 案例1:;算术();中断; 案例2:;三角函数();中断; 案例3:;二次();中断; 案例4:;双变量();中断; 案例5:;三个变量();中断; 默认值:printf(“错误”); } printf(“继续?是/否”); scanf(“%c”,j); 如果(j='y'){ int main(); } 返回0; } int算术(){ int temp1,i,a,n,c=0;//c表示调用函数的次数 float num[n]; 浮动ans=0; printf(“输入输入数量:\0.2t”); scanf(“%d”和“&n”); printf(“输入数字”); 对于(i=0;i,c,gcc,gnu,C,Gcc,Gnu,您正在程序中使用以下函数 #include <stdio.h> #include <stdlib.h> #include <math.h> int arithmetic(); int two_variable(); int three_variable(); int quadratic(); int trigonometric(); //declaring all the main functions int main(void){ char j;
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int arithmetic();
int two_variable();
int three_variable();
int quadratic();
int trigonometric();
//declaring all the main functions
int main(void){
char j;
int select;
printf("Enter mode\n 1. Arithmetic \t 2.Trigonometric \n 3.Quadratic\t 4.Two Variable\n \t 5.Three Variable \n");
scanf("%d",&select);
switch(select){
case 1: ; arithmetic(); break;
case 2: ; trigonometric();break;
case 3: ; quadratic(); break;
case 4: ; two_variable();break;
case 5: ; three_variable();break;
default: printf("ERROR");
}
printf("Continue? y/n");
scanf("%c",j);
if(j == 'y'){
int main();
}
return 0;
}
int arithmetic(){
int temp1,i,a,n,c = 0; //c is for count the no. of times function was called
float num[n];
float ans = 0;
printf("enter number of inputs:\0.2t");
scanf("%d",&n);
printf("enter numbers");
for(i=0;i<=n;i++){
scanf("%f",&num[i]);
}
printf(" 1.+ \t 2.- \n 3.* \t 4./t /n 5.^ /t 6.log ");
scanf("%d",a);
switch(a){
case 1://addition
for(i=0;i<n;i++){
ans += num[i];
}
break;
case 2://subtraction
for(i=0;i<n;i++){
ans -= num[i];
}
break;
case 3://multiplication
for(i=0;i<n;i++){
ans = 1;
ans *= num[i];
}
break;
case 4://division
ans = 1;
for(i=0;i<n;i++){
ans = ans/num[i];
}
break;
case 5: //power
ans = pow(num[0],num[1]);
break;
case 6 : //log
if(c>1){
ans = log(temp1); }
else{
ans = log(num[0]); }
break;
default :printf("ERROR");
}
temp1 == ans;
printf("ans = %f",ans);
char j;
printf("Continue? y/n");
scanf("%c",j);
if(j == 'y'){
int arithmetic();
}
return 0;
}
但是您只实现了算术()函数,而没有实现其他函数。实现这些函数,错误就会消失。ohh..请修复语法。您的代码只实现由
main
定义和调用的5个函数之一。int two_variable(){}
int two_variable(){}
int quadratical(){}
int trigonal(){}
?请尝试创建一个示例来向我们展示。请。并包括您得到的实际错误,完整、完整且未经编辑。
arithmetic();
trigonometric();
quadratic();
two_variable();
three_variable()