//interchanging the value of two variable #include<stdio.h> void main() { int a,b,t; printf(“enter the value of a and b\n”); scanf(“%d%d”,&a,&b); …
Learn Anytime Anywhere
//interchanging the value of two variable #include<stdio.h> void main() { int a,b,t; printf(“enter the value of a and b\n”); scanf(“%d%d”,&a,&b); …
//To check whether the given number is prime or not #include<stdio.h> void main() { int i, n; printf(“enter the value …
#include<stdio.h> void main() { int i, j; for(i=6;i>=0;i–) { for(j=0;j<=i;j++) printf(“\tNEPAL”); printf(“\n”); } for(i=1;i<=6;i++) { for(j=0;j<=i;j++) printf(“\tNEPAL”); printf(“\n”); } } …
#include<stdio.h> void main() { int i,j; for(i=1;i<=10;i++) { for(j=1;j<=i;j++) printf(“\t*”); printf(“\n\n”); } } output
//Program to check whether the number is even or odd #include<stdio.h> void main() { int n; printf(“enter the value of …
//greatest number among three numbers#include<stdio.h>void main(){int a,b,c, greatest;printf(“enter three numbers:”);scanf(“%d%d%d”,&a,&b,&c);if(a>b && a>c)greatest=a; …
//leap year #include<stdio.h> void main() { int year; printf(“enter the year\n”); scanf(“%d”,&year); if(year%100==0) { if(year%400==0) printf(“the year is leap\n”); else …
//use of case statement #include<stdio.h> void main() { int choice, a,b,result; printf(“Enter the choice\n1.Add\n2.Substract\n3.Multiply\n4.Division\n “); scanf(“%d”,&choice); printf(“enter the two numbers”); …
#include<stdio.h> void main() { int r,n, sum=0,i=1; printf(“enter the value of n”); scanf(“%d”,&n); while(n!=0) { r=n%2; sum=sum+r*i; n=n/2; i*=10; } …
#include<stdio.h> #include<math.h> void main() { int n, sum=0, p=0,r,num, rem,check; printf(“enter the value of n\n”); scanf(“%d”,&n); num=n; while(num!=0) …