| | |
can't display the output! can somebody help me?!! PLS..
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
C Syntax (Toggle Plain Text)
#include<stdio.h> #include<string.h> #define size 21 #define max 5 int id[max][size]; char ln[max]; int pr[max]; int mt[max]; int fg[max]; void getrecord() { int i; for(i=0;i<=4;i++) { clrscr(); printf("id number:"); scanf("%d",id[i]); printf("last name:"); scanf("%s",ln[i]); printf("prelim:"); scanf("%d",pr[i]); printf("midterm:"); scanf("%d",mt[i]); fg[i]=(pr[i]*0.4)+(mt[i]*0.6); } getch(); } void displayreverse() { int i,p; clrscr(); printf(" idno. lstnme prelim midterm fgrde"); for(i=4;i<=0;i--); { p=0;p++; gotoxy(5,9+p); printf("%d",id[i]); gotoxy(5,9+p); printf("%s",ln[i]); gotoxy(5,9+p); printf("%d",pr[i]); gotoxy(5,9+p); printf("%d",mt[i]); gotoxy(5,9+p); printf("%d",fg[i]); } getch(); } main() { getrecord(); displayreverse(); exit(0); }
can someone help me??
this is a program i created wherein the function getrecord() accepts data up to 5 times and a displayreverse() wherein it display all the data from the last input to the first input.
it works but it doesn't display the output!
Is there something wrong in my displayreverse() function??
pls help me!!!! HELP!!!
this is a program i created wherein the function getrecord() accepts data up to 5 times and a displayreverse() wherein it display all the data from the last input to the first input.
it works but it doesn't display the output!
Is there something wrong in my displayreverse() function??
pls help me!!!! HELP!!!
i can't display the outputs.
like when i entered all the data 5times in the getrecord()
when it goes to the function displayreverse after inputing all the needed data, it does not display all the output. the output is just
" idno. lstnme prelim midterm fgrde"
and the inputted data didn't appear at all even though i entered all the data needed
like when i entered all the data 5times in the getrecord()
when it goes to the function displayreverse after inputing all the needed data, it does not display all the output. the output is just
" idno. lstnme prelim midterm fgrde"
and the inputted data didn't appear at all even though i entered all the data needed
Here are some problem with your code
1)
replace it like
2) The same problem with other scanf also. Give address to scanf.
ex :
1)
C Syntax (Toggle Plain Text)
printf("last name:"); scanf("%s",ln[i]);
replace it like
C Syntax (Toggle Plain Text)
printf("last name:"); scanf("%s",ln);
2) The same problem with other scanf also. Give address to scanf.
ex :
C Syntax (Toggle Plain Text)
scanf("%d",&(pr[i]));
Last edited by dilip.mathews; Aug 1st, 2006 at 9:33 am.
my problem is not in inputting the data, but in displaying the outputs.
like for example:
when i input all the data: like
id number:1
lastname:smith
prelim:60
midterm:100
id number:23
lastname:wirth
prelim:65
midterm:100
id number:3
lastname:smith
prelim:60
midterm:76
id number:3
lastname:taylor
prelim:55
midterm:15
id number7
lastname:scott
prelim:6
midterm:10
so i get a 5 inputs,and then after inputting it should display all these data in the screen.
like for example:
when i input all the data: like
id number:1
lastname:smith
prelim:60
midterm:100
id number:23
lastname:wirth
prelim:65
midterm:100
id number:3
lastname:smith
prelim:60
midterm:76
id number:3
lastname:taylor
prelim:55
midterm:15
id number7
lastname:scott
prelim:6
midterm:10
so i get a 5 inputs,and then after inputting it should display all these data in the screen.
Try changing this part in
Please do not use
displayreverse()void displayreverse()
{
int i,p;
printf(" idno. lstnme prelim midterm fgrde");
for(i=4;i>=0;i--);
{clrscr, and gotoxy. Those functions are not standard functions. Since you are obviously a student, try to learn the correct usage of the C language. Modern compilers which are more standard compilant than TurboC does not compile your program. Search for the DevCPP compiler in google and download it. It is a very good compiler for beginners. バルサミコ酢やっぱいらへんで
![]() |
Similar Threads
- Starting Python (Python)
- array output came many times (char,int array) (C++)
- Video output problem with TV tuner card (PCI and Add-In Cards)
- Help with a reservation program! GUI Messed XD (Java)
- header file/ classes (C++)
- Array troubles? (C++)
- need links wher i can find c++ codes lots of them!!! (C++)
- help with sort using Calendar class getting null pointer exception (Java)
Other Threads in the C Forum
- Previous Thread: Ask Function problem?thanks
- Next Thread: Confused
Views: 2573 | Replies: 19
| Thread Tools | Search this Thread |
Tag cloud for C
#include * .net append array arrays asterisks binarysearch calculate changingto char character cm command copyimagefile cprogramme creafecopyofanytypeoffileinc database directory dynamic execv feet fgets file fork forloop framework function functions givemetehcodez grade graphics gtkwinlinux hacking histogram homework include incrementoperators input intmain() iso kernel keyboard km lazy license linked linkedlist linux list lists locate logical_drives looping loopinsideloop. lowest matrix microsoft mqqueue mysql number oddnumber odf opensource overwrite owf pdf performance pointer pointers posix probleminc process program programming radix recursion recv recvblocked research reversing scanf scripting segmentationfault sequential socket spoonfeeding standard string student systemcall testing threads turboc unix user variable wab whythiscodecausesegmentationfault windowsapi






