Only help No homeworks doing forum.
WaltP commented: Badly formatted code is rarely a help -2
Only help No homeworks doing forum.
Looks very complicated .. It is better to use switch statement.
Y you have used iomanip header file .
Also tell me Y You have used Conio header file.Using header files without there usage gives a bad impression.
Already mentioned you have to use int main() because you have given "return 0" at the end of main.No coding tags ,it puts bad impression.
First think what you are going to do .
Then find easy ways for programming
Write algorithm
convert it into codes.
It is what programming is.....
If u need help in cplusplus then visit http://www.cplusplus.com/doc/tutorial/.
Thanks for a great help waltp .
In avg marks you take all the values and divide by the total number , In that different values will show different percentage . So it means no direct method to obtain correct percentage.
No main function , If you don't write main function then how can you use your program.Complete your main function then this program will start working.
Is there is any way to copy out put in graphics into a paint file(bmp)?:)
>> Warp your codes in coding tags
>> It is c++ forum not a c forum
>> i has a datatype int , it should be char
>>Use ascii codes when you use char
Read this article it will help you
"http://notfaq.wordpress.com/2006/08/30/c-convert-int-to-string/"
>> Try to use Codes in Coding tags
>> Try to use cout statement out of looping statement .
#include<iostream>
#include<conio>
int main()
{
int arr[10];
int i,j,sum=0,flag;
cout<<"Enter the Integers : ";
for(i=0;i<10;i++)
cin>>arr[i]; //Loop Takes ten integer
for(i=0;i<10;i++)
{
flag=0; // Flag is assigned 0 intially
for(j=i+1;j<10;j++)
if(arr[i]==arr[j]) // Any integer repeat then flag becomes 1
flag=1;
if(flag==0) //If any integer is repeated then it is not counted
sum=sum+arr[i];
}
cout<<" Sum is :"<<sum; //Sum is displayed
return 0;
}
I think it might help you..
Thank you for your help . It is some thing best you have done for me.
I am confused in tellg funtion can any body tell me its syntax also for seekg();.
ALREADY ANCIENT DRAGON EXPLAINED THE PROBLEM ONE MORE POINT IN YOUR LOGIC IS TERMINATION OF THE PROGRAMME
USE
while(sign!='Q')
so when you enter Q then it will terminate the programe else it will do your respected task.
I HAVE AN ASSIGNEMENT IN WHICH I GET STUDENT DATA AND SAVE IT A SEPARATE TEXT FILE , THE MAIN PROBLEM IS THAT IT TAKE ALL THE VALUES BUT DONOT STORE VALUE OF SEM,ADD-NO AND BATCH . KINDLY PLEASE HELP ME .
Coding is :-
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
struct stud
{
char *name;
int roll;
float gpa;
char *sem;
char *batch;
char *add;
float cgpa;
};
int main()
{
clrscr();
fstream p("\\DATA.TXT",ios::out);
int check;
struct stud s;
while(check!=4)
{
clrscr();
cout<<"\n\n\t\tWELLCOME TO DATABASE FOR STUDENTS(SEMESTER SYSTEM)";
cout<<"\n\n\t\t\t PRESS 1 FOR ENTERING DATABASE";
cout<<"\n\n\t\t\t PRESS 2 FOR VIEWING DATABASE";
cout<<"\n\n\t\t\t PRESS 3 FOR DELETING DATABASE";
cout<<"\n\n\t\t\t PRESS 4 TO EXIT";
cout<<"\n\n\n\n\t\t\tENTER YOUR OPTION : ";
cin>>check;
if(check==1)
{
clrscr();
cout<<"\n\nENTER STUDENT NAME : ";
cout<<"\n\n********************************";
cout<<"\n\nENTER ROLL NUMBER : ";
cout<<"\n\n********************************";
cout<<"\n\nENTER GPA : ";
cout<<"\n\n********************************";
cout<<"\n\nENTER YOUR SEMESTER : ";
cout<<"\n\n********************************";
cout<<"\n\nENTER YOUR BATCH : ";
cout<<"\n\n********************************";
cout<<"\n\nENTER YOUR AD-NO : ";
cout<<"\n\n********************************";
cout<<"\n\nENTER YOUR CGPA : ";
cout<<"\n\n********************************";
gotoxy(21,3);
cin>>s.name;
gotoxy(21,7);
cin>>s.roll;
gotoxy(12,11);
cin>>s.gpa;
gotoxy(22,15);
cin>>s.sem;
gotoxy(19,19);
cin>>s.batch;
gotoxy(19,23);
cin>>s.add;
gotoxy(18,27);
cin>>s.cgpa;
//EOS for end of entry and EOL for end of line
p<<s.name<<"(EOS)"<<s.roll<<"(EOS)"<<s.gpa<<"(EOS)"<<s.sem<<"(EOS)"<<s.batch<<"(EOS)"<<s.add<<"(EOS)"<<s.cgpa<<"(EOF)";
}
}
return 0;
}
use system("pause")
or use getch(); before return so it will wait for carriage return and you can see the output .
use this
while((c=getche()!='\r')
{
cout<<"*";
i++;
}
dont use int with such a big number .
first Open your comments , because you prototype file name char name all these are closed in the comments symbol , don't use void inside main for calling a function just write the name of function and sending parameters .
Like proceed(com,metric)
don't write the data type with it .
Your mistake is
void proceed(struct registeration com,int matric)
make it
proceed(com,matric)
also
do the same procedure with your again funtion and Mark the thread solved if it solves your probelm.
One of the main problem is you are using constant more than int range , use float or long for it
float matric;
Or
long matric;
You need A "for" loop before checking the ancient dragon given condition.
Well actually i mean "while((*p=getchar())!='\n') i++; ".Thank You pointing out my mistake .
I know u are right but that some thing according to his needs , he can use "getchar" instead of "getche".
int i=0; //Temp var
char *p=new char; // p having zero length
while((*p=getche())!='\r') // getting character
i++; // increment according to need
I think this will help you!
actually Your function is calling again and again . It is a concept of recursive function in which each values are stored in memory after each call until termination.
i think know u understand
like i=4 and j=4 so it will become 4pow4 = 256
"i" is actually the number and "j" is its power.
Actually You are calling a recursive function ....
it will continue until value of j becomes 1
static int Var[2];
Instead of intilaizing to zero use static before int.
LIKE
static int g[2];
I have a string , i want to give it a blink effect ... is there any specific function for it .
Well......... I know its a mistake but i want her to study these things , every time u cannot write what is going on and what is not , and if a person use 1% of his/her brain he/she can know what does that mean ............
cool down buddy , Thanks For Your help.
can you help me by some logical structure?
I have given this program only to develop your logic ,it is not a standard form .
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#define n 4
void main()
{
//variables
float table[n];
int no=1,i;
float x=0;
float d;
clrscr();
//program
for (i=0; i<n; i++)
{
printf("Enter the number %d : ", i);
scanf("%f", &table[i]);
}
for (i=0; i<n; i++)
{
if(x==0 && i!=0)
no=0;
else
x=table[i];
}
if (no==0)
printf("\nThe division cannot be made");
else
{
d=table[0];
for(i=1;i<n;i++)
d=d/table[i];
printf("\nThe division is %f ", d);
}
getch();
}
It will Help you !
is their any way we can make int value into string
i Dont have window.h header file , can i make a programme for copying picture from one drive to another?Any one help me in interpets . I am new using c++ so please please help.
How to open a picture in c++ ( jpeg or any other format)
Can Any One Tell Me How To Handle Registers In C ,while We Are Dealing With Mouse Handling ... Can Any One Explain With Some Example.
How can i Configure Mouse in C:-/