float f=-123.567F;inti=(int)f.则i的值现在是()。
union u{char ch;int i;float f;};定义了共用体变量.
#include void main(){ int max(flaot x, float y);float a, b;int c;scanf(“%f,%f”, &a, &b);c=max(a, b);printf(“Max is %d”, c);}int max(float x, float y){ float z;z = x > y ? x : y;return z;}函数max的返回值是什么数据类型( )
以下程序的输出结果是double f(int n){ int i; double s;s=1.0;for(i=1; i<=n; i++) s+=1.0/i;return s;}main(){ int i,m=3; float a=0.0;for(i=0; i
有以下程序struct STU{char num[10];float score[3];}main(){struct STU s[3]={{\20021\,90,95,85},{\20022\,95,80,75},{\20023\,100,95,90}},*p=s;int i; float sum=0;for(i=0;i<3;i++)sum=sum+p->score[i];printf(\%6.2f\\n\,sum);}程序运行后的输出结果是()
float f=15.6F;int i=(int)f;System.out.println(\f=\+f);以上代码片段执行后的结果是
测试如下变量声明: String s =' '; float f= OF ; int i = 0; 下述哪些语句是合法的 ?
已有定义:float f=13.8;,则表达式:(int)f%3的值是1。
若有以下定义语句: union data {int i;char c;float f;)a; int n=5; 则以下语句正确的是()。
若定义:int a=7;int b=2;,则运行printf(“%f”,(float)a/b);后结果为()。
若有说明语句int i=4, j=5, k=6; float f; 则执行f=(i>k)?i:(j<k)?j:k;语句后,f的值为()。
有以下程序 struct STU {char num[10];float score[3];}; main() {stmct STU s[3]={{“20021”,90,95,85}, {“20022”,95,80,75}, {“20023”,100,95,90}},*p=s; int i;float sum=0; for(i=0;i<3;i++) sum=sum+p->score[i]; printf(“%6.2f\n”,sum); } 程序运行后的输出结果是
有下列函数定义:fun(float h){printf("%f,%f\n",h,h*h);}该函数的类型是()。A.int类型B.float类型
设i是int型变量,f是float型变量,用下面的语句给这2个变量输入值。为了将,100和765.12分别赋给i和f,则正确的输入为______。 scanf("i=%d,f=%f”,&i,&f);
定义int a; float f; double i; 6.定义表达式15+i*f+ˊAˊ的值是() 。
设变量a是 int 型,f是 double 型,i是 float 型,则表达式10+'a'+i*f值的数据类型
"若有以下定义和语句union data{ int i;char c;float f;}a;则以下语句不正确的是()
定义一个共用体,包括的数据成员有整型、字符型和实型。union data{int i;char ch;float f;}a;针对上面代码说明正确的是()
以下代码执行后,不会报错的是() int i = 0; decimal d = 0; float f = 0; char ch=’0’;
请分析指出以下代码中存在的问题。 public class My_Average_scores { public float getAverage(String [] scores ) { if (scores==null || scores.length==0) { throw new NullPointerException(); } float sum = 0.0F; int j=scores.length; for (int i=1; i<j; i++) { sum += scores[i]; } return sum/j; }
以下结果为整数的表达式(设有int i;char c;float f;)()
设 int n ; float f=13.8; 执行 n= () 4.6
设i为int型。f为float型,则10 + i+'f''的数据类型为()
有以下程序: include<stdio.h> include <string.h> typedef struct char name[9]; char sex; float score[2]; STU; void f(STU a) STU b="Zhao", "m", 85.0, 90.0; int i; strcpy(a.name, b.name); a.sex=b.sex; for (i=0