Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a c code segment using a for loop that calculates and
prints the sum of the even integers from 2 to 30, inclusive?

Answer Posted / parekh nirav

#include<stdio.h>
#include<conio.h>
void main()
{
int i,no,sum=0;
clrscr();
printf("\n entre the no:-");
scanf("%d",&no);

for(i=2;i<=30;i+1)
{
printf("\n the list is %d",i);
sum=sum+i;
}
printf("\n the sum is %d",sum);
getch();
}

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are the outer parentheses in return statements really optional?

1122


Why isn't any of this standardized in c? Any real program has to do some of these things.

1223


Is it fine to write void main () or main () in c?

1033


Explain how can a program be made to print the line number where an error occurs?

1224


What is static memory allocation? Explain

1107


How can type-insensitive macros be created?

1173


What is a loop?

1070


What is null pointer in c?

1002


write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

2871


difference between Low, Middle, High Level languages in c ?

2089


what are the different storage classes in c?

1184


what will be maximum number of comparisons when number of elements are given?

1911


FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.

1757


Differentiate fundamental data types and derived data types in C.

1036


How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

1118