Как я могу использовать цикл while в этом уравнении в файле программы C
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[^]
Что я уже пробовал:
#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; }