'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();

PSCS 30-07-2020

1. a)13.33m/s
2.d)none of these
3.b) 12 km/hr
4.a)2000
5.b)!5 km/h
6.a)64 km/h
7.c)80 km
8.a)230
9.b)792
10.c)60 kmph
11.b) 45s
12.d)45,10
13.d)8
14.d)4:3
15.d)40 seconds
16.c) 6 km
17.a)160 km
18.b)90 kmph
19.b) 444 km
20.b) 48

PROGRAM:
#include<stdio.h>

int find_factorial(int n)
{
    int fact=1,i;
    
    for(i=1;i<=n;i++)
        fact=fact*i;
    return fact;
}


int main()
{
    int n;
    scanf("%d",&n);
    printf("%d",find_factorial(n));
    
    return 0;
}


PROGRAM:

f_in = open("input.txt","r")

s=f_in.read()

words=len(s.split())

lines=len(s.split("\n"))


sp=0
al=0
d=0
for i in s:
    if(i.isalpha()):
        al+=1
    if(i.isdigit()):
        d+=1
    if(i == " "):
        sp+=1
print("Alphabets :",al)
print("NUmerics :",d)
print("Spaces :",sp)
print("Words :",words)
print("Lines :",lines-1)

No comments:

Post a Comment