Majestics 84 Posting Pro

Only help No homeworks doing forum.

Majestics 84 Posting Pro

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.

Majestics 84 Posting Pro

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.

Majestics 84 Posting Pro

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/.

Majestics 84 Posting Pro

Thanks for a great help waltp .

Majestics 84 Posting Pro

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.

Majestics 84 Posting Pro

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.

Majestics 84 Posting Pro

Is there is any way to copy out put in graphics into a paint file(bmp)?:)

Majestics 84 Posting Pro

>> 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

Majestics 84 Posting Pro
Majestics 84 Posting Pro
Majestics 84 Posting Pro

>> 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..

Majestics 84 Posting Pro

Thank you for your help . It is some thing best you have done for me.

Majestics 84 Posting Pro

I am confused in tellg funtion can any body tell me its syntax also for seekg();.

Majestics 84 Posting Pro

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.

Majestics 84 Posting Pro

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;
   }
Majestics 84 Posting Pro

use system("pause")
or use getch(); before return so it will wait for carriage return and you can see the output .

Majestics 84 Posting Pro

use this

while((c=getche()!='\r')
{
cout<<"*";
i++;
}

Majestics 84 Posting Pro

dont use int with such a big number .

Majestics 84 Posting Pro

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.

Majestics 84 Posting Pro

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;

Majestics 84 Posting Pro

You need A "for" loop before checking the ancient dragon given condition.

Majestics 84 Posting Pro

Well actually i mean "while((*p=getchar())!='\n') i++; ".Thank You pointing out my mistake .

Majestics 84 Posting Pro

I know u are right but that some thing according to his needs , he can use "getchar" instead of "getche".

Majestics 84 Posting Pro

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!

Majestics 84 Posting Pro

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.

Majestics 84 Posting Pro

U can like this "Number==5"

Majestics 84 Posting Pro

i think know u understand

Majestics 84 Posting Pro

like i=4 and j=4 so it will become 4pow4 = 256

Majestics 84 Posting Pro

"i" is actually the number and "j" is its power.

Majestics 84 Posting Pro

Actually You are calling a recursive function ....
it will continue until value of j becomes 1

Majestics 84 Posting Pro

static int Var[2];

Majestics 84 Posting Pro

Instead of intilaizing to zero use static before int.

LIKE

static int g[2];

Majestics 84 Posting Pro

I have a string , i want to give it a blink effect ... is there any specific function for it .

Majestics 84 Posting Pro

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 ............

Majestics 84 Posting Pro

cool down buddy , Thanks For Your help.

Majestics 84 Posting Pro

can you help me by some logical structure?

Majestics 84 Posting Pro

I have given this program only to develop your logic ,it is not a standard form .

Majestics 84 Posting Pro
#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 !

WaltP commented: Badly formatted code is rarely a help -2
Majestics 84 Posting Pro

is their any way we can make int value into string

Majestics 84 Posting Pro

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.

Majestics 84 Posting Pro

How to open a picture in c++ ( jpeg or any other format)

Majestics 84 Posting Pro

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.

Majestics 84 Posting Pro

How can i Configure Mouse in C:-/