simple programme to add two numbers
# include <stdio.h>
#include<conio.h>
void main();
{
int a,b,sum;
printf("Enter any two numbers:\n");
scanf("%d%d",&a,&b);
sum=a+b;
printf("\nThe sum of two numbers is:%d",sum);
getch();
}
output
Enter any two numbers:
_5 _4
The sum of two numbers is:9
/*Here 5,4 and 9 are only examples we will add any two numbers
using this programme
/*Programme to display Nepali flag*/ # include <stdio.h> #include <stdlib.h> void main() { int i,j; for(i=1;i<=20;i++) { if(i<=8) { for(j=1;j<=8;j++) { if(j==1||i==j&&i<8) printf("* "); else if(i==8&&j>=3) printf("* "); else printf(" "); } } else if(i>8&&i<=12) { for(j=1;j<=7;j++) { if(i==12||j==1||i-j==5) printf("* "); else printf(" "); } } else if(i>12) printf("* "); printf("\n\n\n"); } }
Comments
Post a Comment