Sum of Digit Using Goto Statement C Program Tamil


#include<stdio.h>
#include<conio.h>
void main()
{
	int n,sum=0,r;
	clrscr();
	printf("\nEnter the number :");
	scanf("%d",&n);
	s:
	r=n%10;
	n=n/10;
	sum=sum+r;
	if(n!=0)
	{
		goto s;
	}
	printf("\nSum = %d",sum);
	getch();
}

Login To Download Source Code

Leave a Comment:

Login To Comment

List Of Programs


Goto Examples

Operators

Looping

Number Conversion

Pattern Design

Arrays

Matrix Examples

Sorting Examples

String Function

Change Case

String In C

Maths Functions

User Defined Functions

Recursive Functions

Pointer

Structure

File Concept

Calender Programming