A

@adarshb2005

Program to print table for the given number using while loop in C

C
2 years ago
#include <stdio.h> int main() { int num, i = 1; printf("Enter a number to print its multiplication table: "); scanf("%d", &num); printf("Multiplication table for %d:\n", num);

Program to print first 10 multiples of 5 using do-while loop

C
2 years ago
#include <stdio.h> int main() { int count = 1; printf("The first 10 multiples of 5 are: \n"); do { printf("%d\n", 5 * count); count++;

Program to print your name N times using do-while loop

C
2 years ago
#include <stdio.h> int main() { int N; printf("Enter the number of times you want to print your name: "); scanf("%d", &N); if (N <= 0) { printf("Please enter a positive number greater than 0.\n");

Program to print half Pyramid of numbers using nested loops

C
2 years ago
#include <stdio.h> int main() { int rows; printf("Enter the number of rows for the half pyramid: "); scanf("%d", &rows); if (rows <= 0) { printf("Please enter a positive number of rows.\n");

Program to print your name n times using for loop

C
2 years ago
#include <stdio.h> int main() { int n; printf("Enter the number of times you want to print your name: "); scanf("%d", &n); if (n <= 0) { printf("Please enter a positive number greater than 0.\n");

Program to print first 10 natural numbers using while loop

C
2 years ago
#include <stdio.h> int main() { int i = 1; printf("First 10 natural numbers: \n"); while (i <= 10) { printf("%d\n", i); i++;

Program to print the Fibonacci series up to a given number using for loop in C Language

C
2 years ago
#include <stdio.h> int main() { int n, t1 = 0, t2 = 1, nextTerm; printf("Enter the number of terms: "); scanf("%d", &n); printf("Fibonacci Series up to %d terms: \n", n);

Program to enter a number and check whether it is a prime number or not using for loop in C Language

C
2 years ago
#include <stdio.h> int main() { int num, isPrime = 1; printf("Enter a positive integer: "); scanf("%d", &num); if (num <= 1) { printf("Prime numbers are greater than 1.\n");

Program to check whether a number is Armstrong no or not using C Language

C
2 years ago
#include <stdio.h> #include <math.h> int main() { int num, originalNum, remainder, n = 0; double result = 0.0; printf("Enter an integer: "); scanf("%d", &num);

write a C Program to enter a number and check whether that no is the perfect number or not?

C
2 years ago
#include <stdio.h> int main() { int num, sum = 0; printf("Enter a positive integer: "); scanf("%d", &num); if (num <= 0) { printf("Please enter a positive integer.\n");

write a C Program to print the number from 1 to 10 using for loop

C
2 years ago
#include <stdio.h> int main() { for (int i = 1; i <= 10; i++) { printf("%d\n", i); } return 0; }

sum of natural nos

C
2 years ago
#include <stdio.h> int main() { int n,i,sum=0; printf("enter the number\n"); scanf("%d",&n); for(i=0;i<=n;i++){ sum=sum+i; } printf("sum=%d",sum);

odd multiple

C
2 years ago
#include <stdio.h> int main() { int n,i,sum=0; printf("enter the number\n"); scanf("%d",&n); for(i=0;i<=n;i++){ if (i%2!=0) sum=sum+i; }

to multiple 1 to 10

C
2 years ago
#include <stdio.h> int main() { int n,i; printf("enter the number"); scanf("%d",&n); for(i=1;i<=10;++i) { printf("%d*%d=%d\n",n,i,n*i); }

write a c program to compute sum of the first 10 natural nos

C
2 years ago
#include <stdio.h> int main() { int i,sum=0,num; printf("enter the number\n"); scanf("%d",&num) ; for(i=1;i<=num;++i) { sum=sum+i; }

write a program in c to display the first 10 numbers

C
2 years ago
#include<stdio.h> int main() { int i; for(i=1;i<=10;++i) { printf("%d",i); } return 0; }

+×/-

C
2 years ago
#include <stdio.h> int main() { char operator; int num1, num2; printf("Enter operator (+, -, *, /): "); scanf(" %c", &operator); printf("Enter two numbers: "); scanf("%d %d", &num1, &num2); switch (operator) {

Months

C
2 years ago
#include <stdio.h> int main() { int month_number; printf("Enter a month number (1-12): "); scanf("%d", &month_number) switch (month_number) { case 1: printf("Month: January\n");

Here's a C program that uses a switch-case statement to determine if a person is eligible for voting

C
2 years ago
#include <stdio.h> int main() { int age; printf("Enter your age: "); scanf("%d", &age); switch (age) { case 18: printf("You are not eligible for voting.\n");

Write a program using switch case to check the CGPA on given condition. If the CGPA is 8 then print

C
2 years ago
#include <stdio.h> int main() { float cgpa; printf("Enter your CGPA: "); scanf("%f", &cgpa); switch ((int)cgpa) { case 8: printf("You got 8 CGPA.\n");