what is wrong

Thread Starter

mkbutan

Joined Sep 30, 2008
277
hi
i am learning 'C' language and using the DEV C++ compiler but its giving some errors i cant understand how to fix it / what i did wrong or i have to use TC (i don't know what this program is its in our institute ) pl. help
thanks in advance.

the program is as follows :-

/*
Name: M.K.Butan
Copyright:
Author:
Date: 09/02/12 14:15
Description:
*/
#include<stdio>
#include<conio>
void main()
{
int a,b;
int add,sub,mul,div;
printf("\n Enter the Number :");
scanf("%d%d",&a&b);
add=a+b;
sub=a-b;
mul=a*b
div=a/b;
printf("add is :%d",sum);
printf("\n sub is :%d",sub);
printf("\n mul is :%d",mul);
printf("\n div is :%d",div);
getch();
}
 

Attachments

Thread Starter

mkbutan

Joined Sep 30, 2008
277
ok i have removed he name


/*
Name: M.K.Butan
Copyright:
Author:
Date: 09/02/12 14:15
Description:
*/




#include<stdio.h>.h was missing
#include<conio.h>.h was missing
void main()
{
int a,b;
int add,sub,mul,div;
printf("\n Enter the Number :");
scanf("%d%d",&a&b);
add=a+b;
sub=a-b;
mul=a*b;; was missing
div=a/b;
printf("add is :%d",sum);
printf("\n sub is :%d",sub);
printf("\n mul is :%d",mul);
printf("\n div is :%d",div);
getch();
}
 

codehead

Joined Nov 28, 2011
57
but what is this for
/*
Name: M.K.Butan
Copyright:
Author:
Date: 09/02/12 14:15
Description:
*/
Ouch. Looks like you need to spend a little more time "learning 'C' language"...

Anyway, your error messages are pretty clear—the compiler can't find the header files. Can you? If you can, then find out how you need to tell the compiler where they are (hint: it involves file paths). But you need to do some reading first.
 

Thread Starter

mkbutan

Joined Sep 30, 2008
277
Ouch. Looks like you need to spend a little more time "learning 'C' language"...

Anyway, your error messages are pretty clear—the compiler can't find the header files. Can you? If you can, then find out how you need to tell the compiler where they are (hint: it involves file paths). But you need to do some reading first.



sir i have just attended two classes for the 'c'
 

spinnaker

Joined Oct 29, 2009
7,835
sir i have just attended two classes for the 'c'
That no where near does that do it. You are barely getting started. Study, study, study.

Look at examples. Give yourself homework of very simple programs and build from there. Don't try to write the big program first thing.
 

Thread Starter

mkbutan

Joined Sep 30, 2008
277
whats wrong in these TWO program?
Ist on is for the Calculation of Salary ; and the IInd on is for the Conversion of TEMP. F to C
pl help

First

#include<stdio.h>
#include<conio.h>
void main()
{
float basic,da,hra,salary;
printf("\n Enter the Basic Salary :");
scanf("%f",&basic);
da=basic*40/100;
hra=basic*20/100;
salary=basic+da+hra;
printf("\n The Basic Salary is :%f",basic);
prinrf("\n The DA is : %f",da);
prinrf("\n The HRA is : %f",hra);
prinrf("\n The Total Salary is : %f",salary);
getch();
}


Second

#include<stdio.h>
#include<conio.h>
void main()
{
float f,c;
printf("\n Enter the TEMP. in F :");
scanf("%f%f",&f,&c);
c=5/9.0*(f-32);
printf("\n The TEMP. in F : %f",f);
prinrf("\n the TEMP. in C : %f",c);
getch();
}
 

Attachments

Thread Starter

mkbutan

Joined Sep 30, 2008
277
But that is what you posted.


First

#include<stdio.h>
#include<conio.h>
void main()
{
float basic,da,hra,salary;
printf("\n Enter the Basic Salary :");
scanf("%f",&basic);
da=basic*40/100;
hra=basic*20/100;
salary=basic+da+hra;
printf("\n The Basic Salary is :%f",basic);
prinrf("\n The DA is : %f",da);
prinrf("\n The HRA is : %f",hra);
prinrf("\n The Total Salary is : %f",salary); (yes you are right it was not printf))
getch();
}


Second

#include<stdio.h>
#include<conio.h>
void main()
{
float f,c;
printf("\n Enter the TEMP. in F :");
scanf("%f%f",&f,&c);
c=5/9.0*(f-32);
printf("\n The TEMP. in F : %f",f);
prinrf("\n the TEMP. in C : %f",c); (yes you are right it was not printf))
getch();
}




thanks
thanks
thanks
 
Last edited:

codehead

Joined Nov 28, 2011
57
(To my comment, Ouch. Looks like you need to spend a little more time "learning 'C' language"...)

sir i have just attended two classes for the 'c'
Sorry, I wasn't trying to be insulting—I just meant that you need to study a little more before expecting results and asking questions. Comments are one of the very first things taught in any discussion of C or other languages. So, it was obvious that you copied some code from somewhere and modified a little maybe without understanding it. You need to do a little reading first, then try to make something that you think you understand compile. There are so many online resources that teach C from scratch—teach you how to build and compile a "hello world" program, then start adding things.
 

djsfantasi

Joined Apr 11, 2010
6,502
First

#include<stdio.h>
#include<conio.h>
void main()
{
float basic,da,hra,salary;
printf("\n Enter the Basic Salary :");
scanf("%f",&basic);
da=basic*40/100;
hra=basic*20/100;
salary=basic+da+hra;
printf("\n The Basic Salary is :%f",basic);
prinrf("\n The DA is : %f",da);
prinrf("\n The HRA is : %f",hra);
prinrf("\n The Total Salary is : %f",salary);
getch();
}


Second

#include<stdio.h>
#include<conio.h>
void main()
{
float f,c;
printf("\n Enter the TEMP. in F :");
scanf("%f%f",&f,&c);
c=5/9.0*(f-32);
printf("\n The TEMP. in F : %f",f);
prinrf("\n the TEMP. in C : %f",c);
getch();
}
Is this what you intended? "printrf" versus "printf"? "prinrf" is incorrect...
 
Top