add 2 numbers in c
#include<stdio.h>
int main() {
int a, b, sum;
printf("nEnter two no: ");
scanf("%d %d", &a, &b);
sum = a + b;
printf("Sum : %d", sum);
return(0);
add 2 numbers in c
#include<stdio.h>
int main() {
int a, b, sum;
printf("nEnter two no: ");
scanf("%d %d", &a, &b);
sum = a + b;
printf("Sum : %d", sum);
return(0);
sum of individual digits in c using function
#include <stdio.h>
int individualSum(num);
void main ()
{
int num, ret;
ret = individualSum(num);
printf("nThe sum of individual digit is %dn", ret);
}
int individualSum(num)
{
int i, rem, sum = 0;
printf("Enter the number: ");
scanf("%d",&num);
while(num!=0)
{
rem = num % 10;
num = num /10;
sum = sum + rem;
}
return sum;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us