B

@Bhav_9520

sum

C
4 years ago
#include <stdio.h> int main() { int x,y,i=1; long int pow=1,s=0; printf("\n Enter the value of x & y1:"); scanf("%d%d",&x,&y); while(i<=y) {

To find the value of y is raised to the power of x [X^y]::::

C
4 years ago
#include <stdio.h> int main() { int x,y,i=1; long int pow=1; printf("\nEnter the value of x and y"); scanf("%d%d",&x,&y); while(i<=y) {

Generate all combinations of 1 2 3:

C
4 years ago
#include <stdio.h> int main() { int a=1,b=1,c=1; do { printf("\n %d%d%d",a,b,c); a++; b++; c++;

Sum of n natural nos. using switch:

C
4 years ago
#include <stdio.h> int main() { int limit,a=1,s=0; printf("\nEnter how many natural no you want to sum:\n"); scanf("%d",&limit); while(a<=limit) { printf("\n%5d",a); s=s+a; a++;

SI of 5 sets Using While

C
4 years ago
#include <stdio.h> int main() { int p,n=5; float r,t,si; while(n>0) { printf("\nEnter principal,rate,time:"); scanf("%d,%f%f",&p,&r,&t);

Assignment 1 SWITCH for AREA AND PEREMETER

C
4 years ago
#include <stdio.h> int main() { int choice; float l,b,r,pr,ar; printf("\n\t\t\t\t\t\t\tMENU OF AREA \n\n\n1. Rectangle \n2. Square \n3. Circle \n4. Right angled triangle \n5. EXIT"); printf("\n\n Enter your choice:"); scanf("%d",&choice);

Biggest no among 3 no using conditional statement:

C
4 years ago
#include <stdio.h> int main() { int x,y,z,big; printf("\nenter any three no to check greater no:"); scanf("%d%d%d",&x,&y,&z); x>y ? (x>z ? (big=x) : (big=z) ) : ( y>z ? (big=y) : (big=z)); printf("\n Biggest no:%d",big); return 0;

conditional statement for greater no among 2 no:

C
4 years ago
#include <stdio.h> int main() { int x,y,big; printf("\nenter any two no to check greater no:"); scanf("%d%d",&x,&y); x>y ? printf("\n big=%d",x) : printf("\n big=%d",y); return 0; }

find month name using Switch

C
4 years ago
#include <stdio.h> int main() { int a; printf("\nenter month no between 1-12:"); scanf("%d",&a); switch(a) { case 1 : printf("\n jan"); break;

print day name using if-elseif

C
4 years ago
#include <stdio.h> int main() { int day; printf("\n enter day no you want to know:\n"); scanf("%d",&day); if(day==1) printf("\n MONDAY"); else if(day==2) printf("\n TUESDAY");

find large no among 3 no using nesteed if else:

C
4 years ago
#include <stdio.h> int main() { int x,y,z,big; printf("\n enter three no to check greater no:\n"); scanf("%d%d%d",&x,&y,&z); if(x>y) { if(x>z) big=x;

to check entered year is leap year or not:

C
4 years ago
#include <stdio.h> int main() { int a; printf("\nEter a year to check is it leap year or not"); scanf("%d",&a); if(a%4==0) printf("\n %d is leap year",a); else if(a%4!=0) printf("\n %d is not a leap year",a);

swaping with 3 variable

C
4 years ago
#include <stdio.h> int main() { int x,y,t; printf("Enter value A & value B for swapping:"); scanf("%d %d",&x,&y); printf("\n you have enter A=%d & B=%d",x,y); t=x; x=y;

large among 2 no:

C
4 years ago
#include <stdio.h> int main() { int x,y; printf("enter two digit for greater check:\n"); scanf("%d%d",&x,&y); if(x>y) printf("\n big=%d",x); else printf("\n big=%d",y);

Area & peremeter of square

C
4 years ago
#include <stdio.h> int main() { float a,ar,pr; printf("\n enter side of square:\n"); scanf("%f",&a); ar=a*a; pr=4*a; printf("\nArea & of square: %f & peremeter of squarer: %f",ar,pr);

Area and Peremeter of rectangle:

C
4 years ago
#include <stdio.h> int main() { float l,b,ar,pr; printf("Enter area and peremeter of rectangle:\n"); scanf("%f%f",&l,&b); ar=l*b; pr=2*(l+b); printf("\nArea of rectangle: %f and peremeter of rectangle: %f",ar,pr); return 0;

Sum & Avg of 2 int digits:

C
4 years ago
#include <stdio.h> int main() { int x,y,t; float avg; printf("\n Enter 2 digits for sum & average :\n"); scanf("%d%d",&x,&y); t=x+y; avg=t/2.0; printf("Sum of %d & %d is %d and average of %d & %d is %f.\n",x,y,t,x,y,avg);

hello world

C
4 years ago
#include <stdio.h> int main() { printf("Hello world!\n"); return 0; }