The document contains 20 C programs that demonstrate various programming concepts like:
1. Taking input from the user and displaying output
2. Calculating the average, area, power of a number
3. Checking if a number is even/odd, positive/negative
4. Comparing numbers and displaying the largest/smallest
5. Conditional statements like if-else to classify ages, exam scores, leap years
The student requests the teacher to solve the remaining programs in class for learning.
Ex.1 Write a program to print the following pattern
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Ex.2 Write a program to find bigger of three integers.
Ex.3 Write a program to calculate GCD between two numbers.
Ex.4 Write a program to find transpose of matrix.
Ex.5 Write a program which deletes an element from an array & display all other elements.
Ex.6 Write a program to calculate XA+YB where A & B are matrix & X=2, Y=3.
Ex.7 Write a program to calculate the total amount of money in the piggy bank, given that coins of Rs.10, Rs.5, Rs.2, RS.1.
& many more.....
Let us C (by yashvant Kanetkar) chapter 3 SolutionHazrat Bilal
All rights reserved. No part of this slide
may be reproduced, stored in a retrieval
system, or transmitted, in any form or by
any means, without the prior permission.
Ex.1 Write a program to print the following pattern
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Ex.2 Write a program to find bigger of three integers.
Ex.3 Write a program to calculate GCD between two numbers.
Ex.4 Write a program to find transpose of matrix.
Ex.5 Write a program which deletes an element from an array & display all other elements.
Ex.6 Write a program to calculate XA+YB where A & B are matrix & X=2, Y=3.
Ex.7 Write a program to calculate the total amount of money in the piggy bank, given that coins of Rs.10, Rs.5, Rs.2, RS.1.
& many more.....
Let us C (by yashvant Kanetkar) chapter 3 SolutionHazrat Bilal
All rights reserved. No part of this slide
may be reproduced, stored in a retrieval
system, or transmitted, in any form or by
any means, without the prior permission.
These problems are so common that you will find in any C learning curriculum. Either in your college or in any IT institute.
I have provided solutions to these problems as well.
Happy learning...
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
The Indian economy is classified into different sectors to simplify the analysis and understanding of economic activities. For Class 10, it's essential to grasp the sectors of the Indian economy, understand their characteristics, and recognize their importance. This guide will provide detailed notes on the Sectors of the Indian Economy Class 10, using specific long-tail keywords to enhance comprehension.
For more information, visit-www.vavaclasses.com
2. Declare a variable named num and assign the
value 100 to this variable. Display “The value is
100”
int main()
{
int num;
num = 100;
printf("The value is %dn", num);
return 0;
}
3. Write a C program that will take an integer, a float
and a character from keyboard and also display
these inputs.
#include <stdio.h>
int main()
{
int a;
float b;
char ch;
printf("Enter the Character:....n");
scanf("%c", &ch);
printf("Enter the Integer:....n");
scanf("%d", &a);
printf("Enter the float:....n");
scanf("%llf", &b);
printf("nCharacter = %cn", ch);
printf("Integer = %dn", a);
printf("Float = %llfn", b);
}
4. Write a C program that will take two numbers
and display the Average of these numbers
#include <stdio.h>
int main()
{
double a, b, ave;
printf("Enter the two numbers for find their average:....n");
scanf("%lf %lf", &a, &b);
ave = ((a+b)/2.0);
printf("Average is %.1lfn", ave);
return 0;
}
5. Write a C program to convert Celsius to
Fahrenheit. [Formula is: F= (9C/5) + 32].
#include <stdio.h>
int main()
{
float celsius, fahrenheit;
printf("Enter temperature in Celsius: ");
scanf("%f", &celsius);
fahrenheit = ((celsius * 9)/5) + 32;
printf("n%.2f Celsius = %.2f Fahrenheit", celsius, fahrenheit);
return 0;
}
6. Write a program that will display the area of a
rectangle. Take two inputs for length and width of
the rectangle from the keyboard.
#include <stdio.h>
int main()
{
double a, b, c;
printf("Enter the length and width:...n");
scanf("%lf %lf", &a, &b);
c = a*b;
printf("The rectangle is %.1lfn", c);
return 0;
}
7. Write a program that will display the area of a
Triangle. Take two inputs for base and height of
the Triangle from the keyboard
#include <stdio.h>
int main()
{
double a, b, c;
printf("Enter the base and height for find the area of triangle:......n");
scanf("%lf %lf", &a, &b);
c = 0.5 * a * b;
printf("The area of triangle is %.lfn", c);
return 0;
}
8. Write a program that computes the number
of seconds in a year
#include <stdio.h>
int main()
{
int a, b;
printf("Enter the number:....n");
scanf("%d", &a);
b = a / 365;
printf("%d yearn", b);
return 0;
}
9. Swapping of two numbers using C
#include <stdio.h>
int main()
{
int a, b, c=0;
printf("Enter two number:....n");
scanf("%d %d", &a, &b);
c=a;
a=b;
b=c;
printf("The numbers are %d and %dn", a, b);
return 0;
}
10. Write a C program that will take two numbers, first
one for a number, second one for the power and
display the power value of that number.
#include <stdio.h>
int main()
{
int base, power;
long long total = 1;
int i;
printf("Enter base: ");
scanf("%d", &base);
printf("Enter power: ");
scanf("%d", &power);
for(i=1; i<=power; i++)
{
total = total * base;
}
printf("n%d ^ %d = %lld", base, power,
total);
return 0;
}
11. Write a C program that will take a number and
displays the square root of number.
#include <stdio.h>
#include <math.h>
int main()
{
double num, result;
printf("Enter the number:....n");
scanf("%lf", &num);
result = sqrt(num);
printf("%lf number square root is %.1lfn", num, result);
return 0;
}
12. Write a C program that displays from 1 to
100.
#include <stdio.h>
int main()
{
int i;
for(i=1; i<=100; i++)
{
printf("%d, ", i);
}
return 0;
}
13. Write a C program that displays from 100 to 1.
#include <stdio.h>
int main()
{
int i;
for(i=100; i>=1; i--)
{
printf("%d ,", i);
}
return 0;
}
14. Write a C program that displays the even/odd
number from 1 to 100.
#include <stdio.h>
int main()
{
int odd, even, i;
for(i=100; i>=1; i--)
{
if(i%2==0)
{
printf("%d is a even numbern", i);
}
else
{
printf("%d is a odd numbern", i);
}
}
return 0;
}
15. Write a C program that will take an integer
number and display it “EVEN” or “ODD”.
#include <stdio.h>
int main()
{
int num, even, odd;
printf("Enter the number:...n");
scanf("%d", &num);
if(num % 2 ==0 )
{
printf("%d number is a even
numbern", num);
}
else
{
printf("%d number is a odd numbern",
num);
}
return 0;
}
16. Write a C program that will take a year. If its leap
year then display “YES” or otherwise “NO”.
#include <stdio.h>
int main()
{
int year;
printf("Enter year : ");
scanf("%d", &year);
if(((year%4 == 0) && (year%100 !=0))
|| (year%400==0))
{
printf("YESn");
}
else
{
printf("NOn");
}
return 0;
}
17. Write a C program that will take an integer
number and display “POSITIVE” or “NEGATIVE".
#include <stdio.h>
int main()
{
int num;
printf("Enter the number:....n");
scanf("%d", &num);
if(num>0)
{
printf("POSITIVEn");
}
else
{
printf("NEGATIVEn");
}
return 0;
}
18. Write a C program that will take three integer
numbers and display the small number.
#include <stdio.h>
int main()
{
int a, b, c;
printf("Enter the numbers:.....n");
scanf("%d %d %d", &a, &b, &c);
if(a<b)
{
if(a<c)
{
printf("%d is the small numbern", a);
}
else
{
printf("%d is the small numbern", c);
}
}
else if(b<a)
{
if(b<c)
{
printf("%d is the small numbern", b);
}
else
{
printf("%d is the small numbern", c);
}
}
return 0;
}
19. Write a C program that will take three integer
numbers and display the middle number
#include <stdio.h>
int main()
{
int a, b, c;
printf("Enter the numbers:....n");
scanf("%d %d %d", &a, &b, &c);
if(a>b)
{
if(a<c)
{
printf("%d is the middle
numbern", a);
}
else
{
printf("%d is the middle
numbern", c);
}
}
else if(b>a)
{
if(b<c)
{
printf("%d is the middle
numbern", b);
}
else
{
printf("%d is the middle
numbern", c);
}
}
return 0;
}
20. Write a C program that will take three integer
numbers and display the large number.
#include <stdio.h>
int main()
{
int a, b, c;
printf("Enter the numbers:....n");
scanf("%d %d %d", &a, &b, &c);
if(a>b)
{
if(a>c)
{
printf("%d is the large numbern",
a);
}
else
{
printf("%d is the large numbern",
c);
}
}
else if(b>a)
{
if(b>c)
{
printf("%d is the large numbern",
b);
}
else
{
printf("%d is the large numbern",
c);
}
}
return 0;
}
21. Write a C program that will take an age and if age less than 10 then display Minor. If
the age between 11 to 19 then display “Teen”, If the age between 20 to 39 then
display “Young”, If the age between 40 to 49 then display “Adult” otherwise “Old”.
#include <stdio.h>
int main()
{
int a;
printf("Enter the
age:.....n");
scanf("%d", &a);
if(a<10)
{
printf("Minorn");
}
else if(a>=11 && a<=19)
{
printf("Teenn");
}
else if(a>=20 && a<=39)
{
printf("Youngn");
}
else if(a>=40 && a<=49)
{
printf("Adultn");
}
else
{
printf("Oldn");
}
return 0;
}
22. Write a C program that will take a number and if the number is less than 40 then display “Fail”. If the
number is between 40 to 49 then display “D”, if the number is between 50 to 59 then display “C”. If
the number is between 60 to 69 then display “B”, if the number is between 70 to 79 then display “A”,
if the number is between 80 to 100 then display “A+”
#include <stdio.h>
int main()
{
int a;
printf("Enter the
numbern");
scanf("%d", &a);
if(a>=40 && a<=49)
{
printf("Dn");
}
else if(a>=50 && a<=59)
{
printf("Cn");
}
else if(a>=60 && a<=69)
{
printf("Bn");
}
else if(a>=70 && a<=79)
{
printf("An");
}
else if(a>=80 && a<=100)
{
printf("A+n");
}
else{
printf("Failn");
}
return 0;
}
23. Thank You
Sir I am sorry that I couldn’t able to do rest the C
program. If you can solve those in our class it will
be great help to us.