Welcome Guest.

1Answers

I want to ask me where is this code wrong? Seeking answers

Asked by: Marie 187 views IT November 25, 2018

#include<stdio.h>

#include<math.h>

int main()

{   

int n;  

  while(n>=100&&n<=999) 

   {    

 if  (pow(n/100,n)+pow(n%10,n)+pow(n/10%10,n)==n) 

 printf("n=%d",n);  

  }

}

Addition: Online, etc., urgent! ! ! ! !

1 Answers

  1. +5Votes  

    First of all, I don’t know what function you want to implement

    Second, your program is completely wrong

    Your n is not initialized, it is a random number

    You The loop does not change the value of n

    and in general, the shaping operation does not use pow

    Amy Cooper- November 25, 2018 |