473,378 Members | 1,078 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

help i hv that code but he is giving me an error in "if" help ;D

#include<stdio.h>
#include<ctype.h>

int na
{
if(a<b && a<c)
printf("%d ",a);
else if(c<b)
printf("%d ",c);
else
printf("%d ",b);
}




[Error] expected primary-expression before 'if'

WHY IT GIVES ME THIS ERROR
Jan 8 '16 #1
1 1062
weaknessforcats
9,208 Expert Mod 8TB
Is na supposed to be a function?

If it is, you need an argument list:

Expand|Select|Wrap|Line Numbers
  1. int na(...arguments go here...)
  2. {
  3. if(a<b && a<c)
  4. printf("%d ",a);
  5.  else if(c<b)
  6. printf("%d ",c);
  7. else
  8.  printf("%d ",b);    
  9. }
  10.  
You also need to define a,b,c, and d.

The compiler knew it was in trouble at the if. The actual error will be there or at some earlier place in the code. Just put your finger on the if and start looking backwards up the code.
Jan 9 '16 #2

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

Similar topics

10
by: Lakshmi Narayanan.R | last post by:
Hi Experts, Using keyword "To" in select case giving error.The following code is got from www.microsrosoft.com itself. What is the wrong with this?. <% Dim Number1 Number1 = 7 ' Initialize...
4
by: Max Harvey | last post by:
Hi, I have looked at the example called "Open Parameter queries from code" from the site http://www.mvps.org/access/queries/qry0003.htm I made up a test which I though looked pretty close...
0
by: Santosh | last post by:
Hii, I am developing web application using asp.net with in that i am using crytal report for showing reports. it works fine on local machine but when i deploy it on the web server it gives me key...
4
by: leaf0209 | last post by:
Hi, I am new to this forum and have been troubled by this problem for the past few days. I would appreciate if someone would take a look and help me out. I am using vb express 2005 edition... ...
1
by: Rahul Bhate | last post by:
Hello Sir My problem is in dos giving error that javac is not recognised.Tell me the steps for debugging.I have already set the CLASSPTH through command line & also set the PATH.But still giving...
4
by: mukeshrasm | last post by:
<?php // create new document pdf_new(); $pdf = pdf_new(); pdf_open_file($pdf); pdf_begin_page($pdf, 500, 700); // define a font $font = pdf_findfont($pdf, "Courier", "host", 0);
4
by: sigkill9 | last post by:
I'm trying to create a script that will accept a user entered integer and find only one set of prime numbers that add up to that integer but need some help. The script is supposed to only accept...
2
by: slizorn | last post by:
hi guys, i get the following error when i try to create a new TreeNode error C2514: 'TreeNode' : class has no constructors this error is caused by the following line:
7
gskoli
by: gskoli | last post by:
Error - working in IE and MOzilla but giving error null or not a object: Guys i am giving you snippet of code , where it is javascript digital clock , It is showing time and working properly but...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.