0% found this document useful (0 votes)
3 views1 page

Count Operations

The document contains a C program that prompts the user to enter a number of integers and calculates their sum. It uses an array to store the integers and includes a count variable to track the number of operations performed. Finally, it outputs the sum of the entered values and the count of operations executed.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Count Operations

The document contains a C program that prompts the user to enter a number of integers and calculates their sum. It uses an array to store the integers and includes a count variable to track the number of operations performed. Finally, it outputs the sum of the entered values and the count of operations executed.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include<stdio.

h>
int main()
{
int count=0,sum=0,n,i,a[50];
count=count+1;
printf("\n enter the value:");
scanf("%d",&n);
printf("\n enter the %d values to sum::",n);
for(i=0;i<n;i++)
{
count=count+1;
scanf("%d",&a[i]);
}
count=count+1;
for(i=0;i<n;i++)
{
count=count+1;
sum=sum+a[i];
count=count+1;
}
count=count+1;
printf("\n the sum of %d values is:%d ",n,sum );
printf("\ncount is:%d",count );
return 0;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy