Home › Forums › C Programming › Problem solving few assignments in C language › Reply To: Problem solving few assignments in C language
August 17, 2007 at 3:25 am
#3238
NAYAN
Participant
question no:17 answer
1 2 3 4 5 6 7 8 9 10 11 12 13 | #include<stdio.h><br /> #include<conio.h><br /> main()<br /> {<br /> int n,sum=0,i;<br /> printf("enter a number");<br /> scnaf("%d",&n);<br /> for(i=0;i<n;i++)<br /> {<br /> sum=sum+i;<br /> }<br /> printf("n the sum is %d",sum);<br /> } |