473,811 Members | 2,979 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

call of nonfunction

7 New Member
#include <stdio.h>
#include <string.h>
#include <conio.h>
#include <ctype.h>

void print_line(); /*function line*/
void show_menu(); /*function menu*/
void circle(float); /*function circle*/
void triangle(float, float); /*function triangle*/
void trapezoid(float ,float,float); /*function trapazoid*/

void main()
{
float radius,circle,a rea,height1,hei ght2,width1,par allel1,parallel 2;
char menu;
clrscr();

do{
printf("Calcula ting Area of Shapes of Grometry\n");
print_line();
show_menu();
scanf("%s",&men u);
menu=toupper(me nu);
print_line();

if(menu=='C') /* check menu */
{ printf("Enter Radius >>"); /* input Radius*/
scanf("%f",&rad ius);
circle(radius); Error call of non function /*link circle*/
}
else if (menu=='T')
{ printf("Enter Width_Triangle >>"); /*input triangle*/
scanf ("%f",&width 1);
printf("Enter Height_Triangle >>");
scanf("%f",&hei ght1);
triangle(width1 ,height1); /*link triangle*/
}
else if (menu=='Z')
{ printf("Enter Parallel_1_Trap ezoid >>"); /*input trapezoid*/
scanf ("%f",&parallel 1);
printf("Enter Parallel_2_Trap ezoid >>");
scanf("%f",&par allel2);
printf("Enter Height_Trapezoi d >>");
scanf("%f",&hei ght2);
trapezoid(heigh t2,parallel1,pa rallel2); /*link trapezoid*/
}
else if (menu=='Q')
{ printf("----------End Program---------------\n");
}}
while (menu!='Q');
getch();
}
void print_line()
{ printf("======= =============== =============== =\n\n");
}
void show_menu()
{ printf(" Menu");
printf("C :: Area of Circle\n");
printf("T :: Area of Triangle\n");
printf("Z :: Area of Trapezoid\n");
printf("Q :: Exit the Program\n\n\n") ;
printf("Select Menu >> ");
}
void circle(float radius) /* function circle*/
{ float circle=0;
circle = 3.14 * radius * radius;
printf("Area of circle is %.2f\n",circle) ;
print_line();
}
void triangle(float width1,float height1) /*function trpangle*/
{ float area=0;
area = 0.5 * width1 * height1;
printf("Area of Triangle is %.2f\n",area);
print_line();
}
void trapezoid(float parallel1,float parallel2,float height2) /*function trapezoid*/
{ float area=0;
area= 0.5 * (parallel1+para llel2) * height2;
printf("Area of Trapezoid is %.2f\n",area);
print_line();

}


help me !! please {Thank You very much}
Aug 27 '09 #1
1 5611
JosAH
11,448 Recognized Expert MVP
You also have a local float variable 'circle'; it hides the declaration of any function named 'circle'. Rename one of them. btw, main() returns an int, it isn't a void function.

kind regards,

Jos
Aug 27 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2311
by: Hubert Baumeister | last post by:
Fifth International Conference on eXtreme Programming and Agile Processes in Software Engineering XP2004 June 6-10, 2004, Garmisch-Partenkirchen, Germany http://www.xp2004.org/
1
3409
by: Marwan | last post by:
Hello I am using asynchronous delegates to make a call to a COM ActiveX object, but even though the call occurs on a separate thread, my UI is still blocking. If i put the thread to sleep in my delegate call, the application is well behaved (no UI freeze), but the call to the com object causes the UI to lock up Do I have to manage calls to an ActiveX object differently than using the BeginInvoke and a callback A sample of the code I...
13
4156
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make sense to punch out from managed code to native code (I was using IJW) in order to do some amount of floating point work and, if so, what that certain amount of floating point work was approximately. To attempt to do this I made a program that...
4
4298
by: John | last post by:
Hi all, This really is quite an urgent matter. I have a page with multiple, dynamically-loaded user controls and when a user clicks on a button, the whole form is submitted. Now at this stage I know I need to call a function that will save data but I'm not sure exactly when to call this function. I've tried two ways and both seem to have 'gotcha's':
13
26601
by: mitchellpal | last post by:
i am really having a hard time trying to differentiate the two..........i mean.....anyone got a better idea how each occurs?
13
9732
by: shsingh | last post by:
I have a class A containing some map as data variables. I creat an object of class A on heap by allocatiing memory by using "malloc". This will return me the required memory but the object is not initialized properly as constructor same is not get called ( as per the behavior). How to call a constructor explicitly if we want to allocate memory using malloc ?
3
4789
by: cberthu | last post by:
Hi all, Is it possible to have two connects in the same rexx script to different DB's? I have to get data form on DB (with specifics selects and filter out some values with RExx) and save the results into another DB? I know from Wscripts and MS-Sql that you can build just two objects but I did not see something like that in REXX. Thanks in advance for your help
9
3280
by: CryptiqueGuy | last post by:
Consider the variadic function with the following prototype: int foo(int num,...); Here 'num' specifies the number of arguments, and assume that all the arguments that should be passed to this function are of type int. (My question has nothing to do with the definition of the function foo, so don't bother about it.) If I call the function as: foo(2,3,4,5,6,7,8);/*More arguments than expected*/
12
7222
by: Rahul | last post by:
Hi Everyone, I have the following code and i'm able to invoke the destructor explicitly but not the constructor. and i get a compile time error when i invoke the constructor, why is this so? class Trial { public: Trial() {
0
9724
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10394
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10127
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9201
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4336
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.