Jump to content
  • Advertisement

Blackdoor_dev

Member
  • Content Count

    19
  • Joined

  • Last visited

Community Reputation

129 Neutral

About Blackdoor_dev

  • Rank
    Member
  1. Blackdoor_dev

    Another basic array C problem

    @rip-off Thanks for helping me out bro.Ill right code clearer from now. :) You are great! I solved all the loops from the exercise including the hard ones.And even solved some character array(String). But in numerical array i stuck badly...and loosing my motivation :c   @ haegarr    Thanks man for helping me :D Ill try to change the environment from Decpp.   @all the other people who helped me  Thanxxxxxxxxxxxxxxxxxxxxxxxxx :)
  2. Blackdoor_dev

    Another basic array C problem

    Okay, then you not should but want to solve the problem by yourself. So what is your concrete question regarding the issues I've already noted?     Then you shall think to turn to another developer environment. You definitely will need a debugger. The given situation is only the first of many others that will come ...   Any suggestion for windows 8.1 64 bit? Good and a bad thing about programming is..I can't use my brain in anything else until i figure out what is wrong with me program
  3. Blackdoor_dev

    Another basic array C problem

    This is possible and fine by itself, of course. But ask yourself what you get by doing so. You get the lowest and the highest temperature. The goal accordingly to (1) is to output the day and the city of two specific temperatures. With your thinking considering (2), the indices of the array are used to denote the specific days and cities, resp. You associate the belonging temperature with a specific day and city by writing the temperature value into the array place that is addressed by that indices; that is fine so far. Now, what happens to that association if you sort the array as is shown in the OP? And this is not my homework. I am self studying this  Debugger in dev cpp is not working on my Windows 8.1 64 bit.  
  4. This is the program Write a program to read the table elements into a two dimensional array temperature and to find the city and day corresponding to  (a)The highest temperature and  (b)The lowest temperature.   This is the source code-     #define MAXDAY 5 #define MAXCITY 3 #include<stdio.h> #include<conio.h> int main(void) { int i,j,city,day,swap; double temp[31][10]; char select; printf("Enter the city temperature and the day temperature"); for(i=0;i<MAXDAY;i++) { day=i+1; for(j=0;j<MAXCITY;j++){  city=j+1; temp[day][city]; printf("Day= %d City=%d ",day,city);   scanf("%d",&temp[day][city]);   } } for(i=1;i<=MAXDAY;i++){ for(j=1;j<=MAXCITY;j++) { if(temp[j]>=temp[i+1][j+1]) { swap=0; swap=temp[j]; temp[j]=temp[i+1][j+1]; temp[i+1][j+1]=swap; } } }   printf("Enter 'H' to see highest temperature or 'L' to see lowest temperature\n And X to break \n"); select=getchar(); switch('select'){ case 'H':printf("\nHighest temperature is  %d in %d city in %d day",temp[1][1],j,i); break; case 'L':printf("\nLowest temperature is %d in %d city in %d day ",temp[5][3],j,i); break;   if(select=='X') {     break;} }         getch();  return 0;                     }       Error-No compilation error Issue-Not getting what i need to.It is not accepting H and L.Even if i don't use the switch case and try to find the highest number only.Still it is not giving that.As if it is not getting sorted.   I wanted to sort that array first and then find the lowest and the highest array.     For me using loops.Character string and function. But when it comes to using array with numerical calculations and all...I am unable to create the algorithm 
  5. Blackdoor_dev

    Basic 2D array C problem

    Not my first programming language studied little bit of Java in school 
  6. Blackdoor_dev

    Basic 2D array C problem

    Ugh brah. I am too much into it right now I finished array now at string which is an array xD As C doesn't support String data type.If in future i go to college then ill need it too :c But i got what u are trying to say...I really hope I can adapt to the change in C++
  7. Blackdoor_dev

    Basic 2D array C problem

    ^^ This! If I could go back and do it over, I'd skip pure C and jump straight to C++. It has been a difficult transition for me.       Why not just C++? L. Spiro   Well I finished school back in 2013.I was a very good student in school.Even got 96% in board's final which is rare.I joined a college to study BCA(Bachelor of Computer Application) and then wanted to study MCA. But after 1 months of college I was struck by a disease(let's say disease X).From that day still now I wasn't able to visit college or do anything.This disease ruined my life kinda. Even I tried to go to the college in between but again failed and I end up wasting my parent's money(they are supportive and in a financial crisis).Maybe I won't able to study in future too.My parents are the best mom and dad of this world with the worst luck of having me.30 days back I thought about not giving up and studying by myself as much as I can and not letting that disease X to win.I started from the books that i got from my college.They were teaching us C,Digital electronics,IT and maths back then.So I started with C.Now I like gaming and everything related to game and I also want to create or together with a team.So i joined this forum.It is really hard to study by myself.From student life I always tend to go to the absolute depth of that when studying.Which is hard to maintain now. :c Thanks for the help guys...And I noted ur point MarkS
  8. Blackdoor_dev

    Basic 2D array C problem

    Sorry bro couldn't reply to you earlier. :c I am actually learning C Array(Right now) from a Book.In which it was asking me to to solve it through array like you said. I am not in school. Next I have to learn array with String and char then Functions and passing of array and strings,,,then union and struct then IO file management and then dynamic memory and then etc etc and then C and C++ and then ill start using Unreal engine 4.After learning little bit about graphics.
  9. Blackdoor_dev

    Basic 2D array C problem

    Thanx Silly mistake is killing me xD Really thanks for the help
  10. Blackdoor_dev

    Basic 2D array C problem

    Nope.  
  11. Blackdoor_dev

    Basic 2D array C problem

    Well, you don't ask the right question and/or give little to no information about your issues.   Your code looks okay at first glance, so it would be really helpful if you have an issue and what the issue is ? Does it not compile ? Not run ? Crash ? Produces not expected result ? What results are you expecting  ? ...   I want to find the multiplication table of 5 numbers It is compiling but giving me number  6 table only 
  12. What am I doing wrong?   //Multiplication table using 2D array #include<stdio.h> #include<conio.h> main() { int  mul[5][5]; int row,column; int i,j;   clrscr(); printf("Here is the multiplication table \n "); for(i=0;i<5;i++); { row=i+1;   for(j=0;j<5;j++) { column=j+1; mul[j]=row*column; printf("%5d",mul[j]); } printf("\n"); } getch(); return 0; }
  13. Blackdoor_dev

    Basic C program what am I doing wrong?

    lol now I am in 2 dimensional Array. I am learning C and then will C++ and then some graphic libraries and then Unreal engine 4. :P I am a long long way off though :D
  14. Blackdoor_dev

    Basic C program what am I doing wrong?

    Okay thanks brothers I solved it #include<stdio.h> #include<math.h> #include<conio.h> void main() { int i,n,p,j; double v,r,t; printf("\n\n\n"); clrscr(); r=0.10; n=10; p=1000; t=pow((1+r),i); // printf("\n\n%.6lf ",t); printf("\nP        R             N             V\n"); for(i=1;i<=n;i++) { if(r<=0.20 && p<=10000) { t=pow((1+r),i); v=p*t; p=p+1000; r=r+0.01; } printf("%d     %lf      %d   ",p,r,n); printf("V=%                          .6lf ",v); printf("\n"); } getch(); } Well I am a noob...No need to mention though
  15. Blackdoor_dev

    Basic C program what am I doing wrong?

      If you set p = v, and then print out v and p, you're just printing out the same value twice.   Yes lol  Thanks!
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!