473,385 Members | 1,356 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,385 software developers and data experts.

Summation in C

Please help me with summation in C lang.

I m trying to divide the summation of alpha * delta with summation of alpha
this is half the program that i have written...but it gives error. pls help..

This is my program, it says invalid indirection in function main ]

i haved use stdio.h and math.h
Expand|Select|Wrap|Line Numbers
  1.  main ()
  2. {
  3. float del1, del2,deli,delj,deln, alpha;
  4. int j,vi,i;
  5. int sum=0;
  6.  
  7. printf ("provide alpha");
  8. scanf .......
  9.  
  10. for (j=1;j<=vi;j++)
  11. sum += alpha [i][j] *deln [j];
  12.  
  13. }
Oct 3 '08 #1
2 2278
gpraghuram
1,275 Expert 1GB
What errors you are getting?

Raghu
Oct 3 '08 #2
boxfish
469 Expert 256MB
You are using alpha as an array, but it is just a float. To make it an array, either declare it as a static array, like this:
float alpha[someSize];

Or as a dynamic array, like this:
float *alpha;
If you declare it as a dynamic array, you will have to allocate memory for it before you use it and free the memory when you are done with it.

Hope this helps.
Oct 3 '08 #3

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

Similar topics

2
by: jim_geissman | last post by:
I have some data -- counts ID'd by location and grid East like this -- Loc East N CA 100 3 CA 103 5 CA 109 2 CA 110 3 I'm interested in the total of N on either side of the largest...
3
NewYorker
by: NewYorker | last post by:
PLEASE PLEASE PLEASE HELP ME ... I AM SO CONFUSED Q1: Given that two int variables, total and amount, have been declared, write a loop that reads integers into amount and adds all the...
1
by: crazydrummer | last post by:
hi everyone, fairly new to access and VBA, but have fundamental knowledge. as part of a college project i am building a database that records "downtime" for machines in a company. the...
14
by: vpascuzzi | last post by:
Hello: I am trying to make a program that will calculate the integral of a function using the Trapezoidal Rule. So far I have this: /* trap.cpp - Trapezoid rule. To evaluate a definite...
7
abouddan
by: abouddan | last post by:
Hi all I am using Access2000 and I am creating a report based on a query. Query1=" select Id,name,Amount from Eployees" This query returns many records, so in the report this result must...
6
by: logieen | last post by:
Hi , Every one I have a problem to solve this summation in c++ ; 1/3 + 3/5 +5/7 ....... this the program I wrote #include <stdio.h> #include <iostream.h> #include <conio.h> #include...
2
by: Asembereng | last post by:
want to read from a database using php commands and grouping by timetype jobdatefrom endyear and nctype and summing the groups for everymonth but instead it sums up for all the months. Here are the...
25
by: Darsin | last post by:
Hi all I need to perform a summation on a column of a table based on a criteria given in another column in the same table. The catch is i need to perform different sums according to the number of...
32
by: =?ISO-8859-1?Q?Szabolcs_Horv=E1t?= | last post by:
I did the following calculation: Generated a list of a million random numbers between 0 and 1, constructed a new list by subtracting the mean value from each number, and then calculated the mean...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...

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.