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

What is c basic?

1138


What is calloc()?

1040


What is the right type to use for boolean values in c? Is there a standard type?

976


What is the purpose of main( ) in c language?

1108


How do you redirect a standard stream?

1066


Why isnt there a numbered, multi-level break statement to break out

1010


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2027


What's the best way of making my program efficient?

1048


What is a lvalue

1047


Tell me about low level programming languages.

1083


What is meant by gets in c?

1118


I heard that you have to include stdio.h before calling printf. Why?

1018


What is enumerated data type in c?

1045


What is uint8 in c?

1067


How do you determine the length of a string value that was stored in a variable?

1097