如何在C程序文件中的此方程式中使用while循环

如何在C程序文件中的此方程式中使用while循环

本文介绍了如何在C程序文件中的此方程式中使用while循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

What is the code for M=log (13*E/4*C) + log (23*E/14*C) +log (33*E/24*C); when E is odd numbers and C is negative numbers in c programming? Note: I must use do while loop for my answer 




also What is the code for k=3.14+ x * tanh (beta); when x is equal to 20 and beta is divisible by 8 in c programming?



< []



我尝试过:




<https://serving.photos.photobox.com/5524842271696cec942256c8b551bdfc2532f223f90844dd88196a152234eddb6c99fb09.jpg[^]

What I have tried:

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <conio.h>



int main(void)
{
    int x;

double k , K;

int E,C, beta=90;
int M;

    char choice;


puts("--------------------------");
  puts("****List of Choices*****");
  puts("--------------------------");
  puts("- Select F or f");
  puts("- Select G or g");
  puts("- Select J");
  puts("--------------------------");
  printf("Your choice: ");
  scanf("%c",&choice);
  puts("--------------------------");

  switch(choice)
  {
    case 'F':
while ( x<=20){
    if (beta%8==0){

    }
    x++;

       K=3.14+ x * tanh (beta);
        printf( "The value of K is:" "%f\n",K);
}
      break;



      case 'f':
while ( x<=20){
    if (beta%8==0){
    }
    x++;

       k=3.14+ x * tanh (beta);
        printf( "The value of K is:" "%f\n",k);
}
      break;


    case 'G':
 // printf( "Enter value of E is:");
  //scanf( "%d",&E);
  //  printf( "Enter value of C is:");
  //scanf( "%d",&C);

    while(E % 2 == 0 && C <0){
M=log(13*E/4*C) + log(23*E/14*C) +log(33*E/24*C);
    }
       printf("The value of M :""%d",M);

      break;



      case 'g':

printf( "Enter value of E is:");
  scanf( "%d",&E);
  printf( "Enter value of C is:");
 scanf( "%d",&C);
while (x=1){
      if(E % 2 == 0 && C <0){
M=log(13*E/4*C) + log(23*E/14*C) +log(33*E/24*C);
    }

    x++;}
       printf("The value of M :""%d",M);
      break;





    case 'J':
      puts("Welcome to Engineering Department ");
  
      break;
    default:
      printf("Error Message:You entered wrong choice");
      break;
      }




getch();
return 0;
}

推荐答案


while( item < 10 ) 
{
  int res = myFunction();
}


这篇关于如何在C程序文件中的此方程式中使用while循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 03:39