100% c function to add 2 numbers

// Online C compiler to run C program online
#include <stdio.h>
int kooDu(int,int);//function prototyping
void main()
{
   int p,q,mottam;
   printf("\n enter two integers:");
   scanf("%d%d",&p,&q);
   mottam=kooDu(p,q);
   printf("\n sum of given numbers %d & %d =%d as printed in main()",p,q,mottam);
}
int kooDu(int a,int b) //function definition
{
    int z;
    z=a+b;
    printf("\n sum of given numbers %d & %d =%d as printed in the called function",a,b,z);
    return(z);
}

ఔట్పుట్ తెరమీద

enter two integers:1
3
sum of given numbers 1 & 3 =4 as printed in the called function
 sum of given numbers 1 & 3 =4 as printed in main()

కామెంట్‌లు

ఈ బ్లాగ్ నుండి ప్రసిద్ధ పోస్ట్‌లు

100% C prog to write content into a file and then read it back onto the console

Spic macay

శ్రీరస్తు.. రామలింగ 18-1-24 (సూరసాని వారి ఆహ్వానము)