GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Placement Papers  >  Freescale Semiconductor
Next Question 
 Freescale Semiconductor  |  Question 1 of 2    Print  
write a program in C to add five 32 bit numbers available at successive memory locations and to divide the result by sixth numer available at next successive location.
main()
{ long int i, sum=0,*p;
p=1001; /* assume the numbers are from 1001 location */
for (i=0;i<5;i++)
{ sum= sum+ *p ;
p=p+1;
}
sum=sum/(*p) ; /* use only /*(p) not /*p since it may come to comment */
printf (\



  
Total Answers and Comments: 1 Last Update: April 20, 2006     Asked by: pvpfirst 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
April 20, 2006 05:22:48   #1  
sivarajan        

RE: write a program in C to add five 32 bit numbers av...
#include int my_array[] = {1,23,-4,5,6,9}; // for example of a random arrayint *ptr ;int sum;long tot;int main(void){ int i; ptr = my_array; //since the name of the array is a pointer for(i=0; i<5; i++) { printf("\n the value of my_array[%d]is %d and is stored in %p ",i,my_array[i], (void *)&(my_array[i])); printf("\n ptr + %d = %d\t",i, *(ptr+i)); sum = sum + *(ptr++); printf("\nthe value of the sum is %d",sum); } tot = sum/(*ptr); printf("\nthe value of the total is %d\n",tot); return 0; }
 
Is this answer useful? Yes | No

 Related Questions

Write a program in C to add five 32 bit numbers available at successive memory locations and to divide the result by sixth numer available at next successive location.
main(){ long int i, sum=0,*p; p=1001; /* assume the numbers are from 1001 location */ for (i=0;i 
Read Answers (1) | Asked by : pvpfirst

Freescale-bit mesra-20061.A dual port memory was given with 1 data port connected in the reverse order. Detect the errors. Repeat for single port.2. input was given as:Design a logic ckt to get the following o/p3. two questions related for calculation of max frequency of operations. Setup and hold time ,clock to Q delay, clock skew and combinational logic delays were to be considered.4. design a state machine for a serial input number to be divisible by 5. if the number is divisible by 5 (101, 1010
View Question | Asked by : Pradeepta


 Sponsored Links

 
Related Articles

C++ Memory Management operators

C Memory Management operators Need for Memory Management operators The concept of arrays has a block of memory reserved The disadvantage with the concept of arrays is that the programmer must know while programming the size of memory to be allocated in addition to the array size remaining constant m
 

How to develop compile and run a C program

The steps involved in building a C program are: 1. First program is created by using any text editor and the file is stored with extension as .c 2. Next the program is compiled. There are many compilers available&nbsp;like GNU C compiler called as gcc, Sun compiler, Borland compiler which is pop
 

JavaScript Location Object

JavaScript Location Object In this JavaScript tutorial you will learn about JavaScript Location Object assign reload replace JavaScript Window Object Methods viz alert blur setInterval and clearInterval Methods of Location Object mosgoogle center assign The assign method of location object is used
 

JavaScript Location Object Properties

JavaScript Location Object Properties In this JavaScript Tutorial you will learn about Properties of Location Object hash host hostname pathname port protocol and search property mosgoogle center The Location object contains information about the current URL This representation is a string that den
 

Quality Aspects to Check While Writing COBOL Program

Quality Aspects to Check While Writing COBOL Program This article gives a general list which the programmer must check while delivering programs developed in COBOL This can also be used as a general checklist for checking quality of the COBOL program developed mosgoogle Quality is a vital factor fo
 

How Consistent Practice Can Help You Improve Your Memory

How Consistent Practice Can Help You Improve Your Memory Researchers have known for a long time that learning a skill in set intervals is the best way to master it Instead of teaching someone a large number of things at once they learn better when the information is split apart in sections mosgoogle
 

Intelligence and Memory

Intelligence and Memory If you wish to improve your memory you will also need to understand the nature of intelligence Intelligence is currently broken down into two categories and these are crystallized intelligence and fluid intelligence mosgoogle Crystallized intelligence deals with the brain pro
 

How To Write The Main Heading For Your Essay

How To Write The Main Heading For Your Essay When you write an essay you will want to make sure you write a good heading To write a good heading you will need to plan your essay very effectively If you remember any good points from lectures these could be things you may want to use to create a good
 

The Foundation of Memory

The Foundation of Memory Many people who are interested in improving their memories will often want to understand its foundation You may have also wandered if the emotion of a person will have an effect on their memory mosgoogle This a complex concept that does not have simple answers because emotio
 

How To Write a Good Essay

How To Write a Good Essay While there are many different methods you can use to write an essay standard essays will follow specific formats Understanding the basic format of an essay will allow you to write informative articles which will capture the attention of those that read it mosgoogle The fir
 

Related Categories
Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape